mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-20 14:49:53 +01:00
Migrate Introduction Screen to ConstraintLayout
Adds RTL support Fixes issue with long contact names Closes #1080
This commit is contained in:
@@ -2,6 +2,7 @@ package org.briarproject.briar.android.introduction;
|
|||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
import android.support.annotation.NonNull;
|
||||||
import android.support.annotation.Nullable;
|
import android.support.annotation.Nullable;
|
||||||
import android.support.v7.app.ActionBar;
|
import android.support.v7.app.ActionBar;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
@@ -82,8 +83,8 @@ public class IntroductionMessageFragment extends BaseFragment
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
public View onCreateView(@NonNull LayoutInflater inflater,
|
||||||
Bundle savedInstanceState) {
|
ViewGroup container, Bundle savedInstanceState) {
|
||||||
|
|
||||||
// change toolbar text
|
// change toolbar text
|
||||||
ActionBar actionBar = introductionActivity.getSupportActionBar();
|
ActionBar actionBar = introductionActivity.getSupportActionBar();
|
||||||
@@ -182,7 +183,7 @@ public class IntroductionMessageFragment extends BaseFragment
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onSendClick(String text) {
|
public void onSendClick(@NonNull String text) {
|
||||||
// disable button to prevent accidental double invitations
|
// disable button to prevent accidental double invitations
|
||||||
ui.message.setSendButtonEnabled(false);
|
ui.message.setSendButtonEnabled(false);
|
||||||
|
|
||||||
|
|||||||
@@ -7,113 +7,121 @@
|
|||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
<LinearLayout
|
<android.support.constraint.ConstraintLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content">
|
||||||
android:orientation="vertical">
|
|
||||||
|
|
||||||
<LinearLayout
|
<de.hdodenhof.circleimageview.CircleImageView
|
||||||
android:layout_width="match_parent"
|
android:id="@+id/avatarContact1"
|
||||||
|
style="@style/BriarAvatar"
|
||||||
|
android:layout_width="42dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_margin="@dimen/margin_activity_horizontal"
|
android:layout_margin="@dimen/margin_large"
|
||||||
|
app:layout_constraintEnd_toStartOf="@+id/introductionIcon"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
tools:src="@mipmap/ic_launcher_round"/>
|
||||||
|
|
||||||
|
<com.vanniktech.emoji.EmojiTextView
|
||||||
|
android:id="@+id/nameContact1"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginEnd="@dimen/margin_large"
|
||||||
|
android:layout_marginStart="@dimen/margin_large"
|
||||||
|
android:layout_marginTop="@dimen/margin_medium"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:orientation="horizontal">
|
android:textColor="?android:attr/textColorPrimary"
|
||||||
|
android:textSize="@dimen/text_size_small"
|
||||||
|
app:layout_constraintEnd_toStartOf="@+id/introductionIcon"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/avatarContact1"
|
||||||
|
tools:text="Contact 1"/>
|
||||||
|
|
||||||
<LinearLayout
|
<android.support.v7.widget.AppCompatImageView
|
||||||
android:layout_width="wrap_content"
|
android:id="@+id/introductionIcon"
|
||||||
android:layout_height="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:gravity="top|center_horizontal"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="vertical">
|
android:layout_margin="@dimen/margin_large"
|
||||||
|
android:src="@drawable/ic_contact_introduction"
|
||||||
|
app:layout_constraintBottom_toBottomOf="@+id/barrier"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="@+id/avatarContact2"
|
||||||
|
app:tint="?attr/colorControlNormal"
|
||||||
|
tools:ignore="ContentDescription"/>
|
||||||
|
|
||||||
<de.hdodenhof.circleimageview.CircleImageView
|
<de.hdodenhof.circleimageview.CircleImageView
|
||||||
android:id="@+id/avatarContact1"
|
android:id="@+id/avatarContact2"
|
||||||
style="@style/BriarAvatar"
|
style="@style/BriarAvatar"
|
||||||
android:layout_width="@dimen/listitem_picture_size"
|
android:layout_width="42dp"
|
||||||
android:layout_height="@dimen/listitem_picture_size"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginEnd="@dimen/listitem_horizontal_margin"
|
android:layout_margin="@dimen/margin_large"
|
||||||
android:layout_marginLeft="@dimen/listitem_horizontal_margin"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
android:layout_marginRight="@dimen/listitem_horizontal_margin"
|
app:layout_constraintStart_toEndOf="@+id/introductionIcon"
|
||||||
android:layout_marginStart="@dimen/listitem_horizontal_margin"
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
tools:src="@mipmap/ic_launcher_round"/>
|
tools:src="@mipmap/ic_launcher_round"/>
|
||||||
|
|
||||||
<com.vanniktech.emoji.EmojiTextView
|
<com.vanniktech.emoji.EmojiTextView
|
||||||
android:id="@+id/nameContact1"
|
android:id="@+id/nameContact2"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="@dimen/margin_small"
|
android:layout_marginEnd="@dimen/margin_large"
|
||||||
android:gravity="center"
|
android:layout_marginStart="@dimen/margin_large"
|
||||||
android:textColor="?android:attr/textColorPrimary"
|
android:layout_marginTop="@dimen/margin_medium"
|
||||||
android:textSize="@dimen/text_size_small"
|
android:gravity="center"
|
||||||
tools:text="Contact 1"/>
|
android:textColor="?android:attr/textColorPrimary"
|
||||||
|
android:textSize="@dimen/text_size_small"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toEndOf="@+id/introductionIcon"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/avatarContact2"
|
||||||
|
tools:text="Contact 2 can have quite a long name"/>
|
||||||
|
|
||||||
</LinearLayout>
|
<android.support.constraint.Barrier
|
||||||
|
android:id="@+id/barrier"
|
||||||
<android.support.v7.widget.AppCompatImageView
|
android:layout_width="wrap_content"
|
||||||
android:id="@+id/introductionIcon"
|
android:layout_height="wrap_content"
|
||||||
android:layout_width="@dimen/listitem_picture_size"
|
app:barrierDirection="bottom"
|
||||||
android:layout_height="@dimen/listitem_picture_size"
|
app:constraint_referenced_ids="nameContact1,nameContact2"/>
|
||||||
android:src="@drawable/ic_contact_introduction"
|
|
||||||
app:tint="?attr/colorControlNormal"
|
|
||||||
tools:ignore="ContentDescription"/>
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:gravity="top|center_horizontal"
|
|
||||||
android:orientation="vertical">
|
|
||||||
|
|
||||||
<de.hdodenhof.circleimageview.CircleImageView
|
|
||||||
android:id="@+id/avatarContact2"
|
|
||||||
style="@style/BriarAvatar"
|
|
||||||
android:layout_width="@dimen/listitem_picture_size"
|
|
||||||
android:layout_height="@dimen/listitem_picture_size"
|
|
||||||
android:layout_marginEnd="@dimen/listitem_horizontal_margin"
|
|
||||||
android:layout_marginLeft="@dimen/listitem_horizontal_margin"
|
|
||||||
android:layout_marginRight="@dimen/listitem_horizontal_margin"
|
|
||||||
android:layout_marginStart="@dimen/listitem_horizontal_margin"
|
|
||||||
tools:src="@mipmap/ic_launcher_round"/>
|
|
||||||
|
|
||||||
<com.vanniktech.emoji.EmojiTextView
|
|
||||||
android:id="@+id/nameContact2"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginTop="@dimen/margin_small"
|
|
||||||
android:gravity="center"
|
|
||||||
android:textColor="?android:attr/textColorPrimary"
|
|
||||||
android:textSize="@dimen/text_size_small"
|
|
||||||
tools:text="Contact 2"/>
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<ProgressBar
|
<ProgressBar
|
||||||
android:id="@+id/progressBar"
|
android:id="@+id/progressBar"
|
||||||
style="?android:attr/progressBarStyleLarge"
|
style="?android:attr/progressBarStyleLarge"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="center"
|
android:layout_margin="@dimen/margin_large"
|
||||||
|
app:layout_constraintBottom_toTopOf="@+id/introductionNotPossibleView"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="@+id/barrier"
|
||||||
tools:visibility="gone"/>
|
tools:visibility="gone"/>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/introductionNotPossibleView"
|
android:id="@+id/introductionNotPossibleView"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_margin="@dimen/margin_activity_horizontal"
|
android:layout_margin="@dimen/margin_large"
|
||||||
android:text="@string/introduction_not_possible"
|
android:text="@string/introduction_not_possible"
|
||||||
android:textSize="@dimen/text_size_large"
|
android:textSize="@dimen/text_size_large"
|
||||||
android:visibility="gone"
|
android:visibility="gone"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/progressBar"
|
||||||
tools:visibility="visible"/>
|
tools:visibility="visible"/>
|
||||||
|
|
||||||
<org.briarproject.briar.android.view.LargeTextInputView
|
<org.briarproject.briar.android.view.LargeTextInputView
|
||||||
android:id="@+id/introductionMessageView"
|
android:id="@+id/introductionMessageView"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="@dimen/margin_large"
|
||||||
android:visibility="gone"
|
android:visibility="gone"
|
||||||
app:buttonText="@string/introduction_button"
|
app:buttonText="@string/introduction_button"
|
||||||
app:hint="@string/introduction_message_hint"
|
app:hint="@string/introduction_message_hint"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/introductionNotPossibleView"
|
||||||
app:maxLines="5"
|
app:maxLines="5"
|
||||||
tools:visibility="visible"/>
|
tools:visibility="visible"/>
|
||||||
|
|
||||||
</LinearLayout>
|
</android.support.constraint.ConstraintLayout>
|
||||||
</ScrollView>
|
</ScrollView>
|
||||||
Reference in New Issue
Block a user