-
-
Notifications
You must be signed in to change notification settings - Fork 6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Legacy group learn more badge and info bottom sheet.
- Loading branch information
1 parent
93f587b
commit 96ce42a
Showing
14 changed files
with
273 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
...ime/securesms/groups/ui/managegroup/dialogs/GroupsLearnMoreBottomSheetDialogFragment.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
package org.thoughtcrime.securesms.groups.ui.managegroup.dialogs; | ||
|
||
import android.os.Bundle; | ||
import android.view.LayoutInflater; | ||
import android.view.View; | ||
import android.view.ViewGroup; | ||
|
||
import androidx.annotation.NonNull; | ||
import androidx.annotation.Nullable; | ||
import androidx.fragment.app.DialogFragment; | ||
import androidx.fragment.app.FragmentManager; | ||
|
||
import com.google.android.material.bottomsheet.BottomSheetDialogFragment; | ||
|
||
import org.thoughtcrime.securesms.R; | ||
import org.thoughtcrime.securesms.util.BottomSheetUtil; | ||
import org.thoughtcrime.securesms.util.ThemeUtil; | ||
|
||
public final class GroupsLearnMoreBottomSheetDialogFragment extends BottomSheetDialogFragment { | ||
|
||
public static void show(@NonNull FragmentManager manager) { | ||
new GroupsLearnMoreBottomSheetDialogFragment().show(manager, BottomSheetUtil.STANDARD_BOTTOM_SHEET_FRAGMENT_TAG); | ||
} | ||
|
||
@Override | ||
public void onCreate(@Nullable Bundle savedInstanceState) { | ||
setStyle(DialogFragment.STYLE_NORMAL, | ||
ThemeUtil.isDarkTheme(requireContext()) ? R.style.Theme_Signal_RoundedBottomSheet | ||
: R.style.Theme_Signal_RoundedBottomSheet_Light); | ||
|
||
super.onCreate(savedInstanceState); | ||
} | ||
|
||
@Override | ||
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { | ||
View view = inflater.inflate(R.layout.groups_learn_more_bottom_sheet, container, false); | ||
|
||
view.findViewById(R.id.lbs_ok_button).setOnClickListener(v -> dismiss()); | ||
|
||
return view; | ||
} | ||
|
||
@Override | ||
public void show(@NonNull FragmentManager manager, @Nullable String tag) { | ||
BottomSheetUtil.show(manager, tag, this); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
app/src/main/java/org/thoughtcrime/securesms/util/BottomSheetUtil.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package org.thoughtcrime.securesms.util; | ||
|
||
import androidx.annotation.NonNull; | ||
import androidx.annotation.Nullable; | ||
import androidx.fragment.app.FragmentManager; | ||
import androidx.fragment.app.FragmentTransaction; | ||
|
||
import com.google.android.material.bottomsheet.BottomSheetDialogFragment; | ||
|
||
public final class BottomSheetUtil { | ||
|
||
public static final String STANDARD_BOTTOM_SHEET_FRAGMENT_TAG = "BOTTOM"; | ||
|
||
private BottomSheetUtil() {} | ||
|
||
/** | ||
* Show preventing a possible IllegalStateException. | ||
*/ | ||
public static void show(@NonNull FragmentManager manager, | ||
@Nullable String tag, | ||
@NonNull BottomSheetDialogFragment dialog) | ||
{ | ||
FragmentTransaction transaction = manager.beginTransaction(); | ||
transaction.add(dialog, tag); | ||
transaction.commitAllowingStateLoss(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<shape xmlns:android="http://schemas.android.com/apk/res/android"> | ||
<corners android:radius="4dp" /> | ||
<solid android:color="@color/core_grey_90" /> | ||
</shape> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<shape xmlns:android="http://schemas.android.com/apk/res/android"> | ||
<corners android:radius="4dp" /> | ||
<solid android:color="@color/core_grey_02" /> | ||
</shape> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
119 changes: 119 additions & 0 deletions
119
app/src/main/res/layout/groups_learn_more_bottom_sheet.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,119 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:app="http://schemas.android.com/apk/res-auto" | ||
xmlns:tools="http://schemas.android.com/tools" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
tools:theme="@style/Theme.Signal.RoundedBottomSheet.Light"> | ||
|
||
<TextView | ||
android:id="@+id/lbs_title" | ||
android:layout_width="0dp" | ||
android:layout_height="wrap_content" | ||
android:layout_marginStart="20dp" | ||
android:layout_marginTop="24dp" | ||
android:layout_marginEnd="20dp" | ||
android:text="@string/GroupsLearnMore_legacy_vs_new_groups" | ||
android:textAppearance="@style/TextAppearance.Signal.Title2" | ||
android:textColor="?title_text_color_primary" | ||
app:layout_constraintBottom_toTopOf="@+id/lbs_paragraph_1_header" | ||
app:layout_constraintEnd_toEndOf="parent" | ||
app:layout_constraintHorizontal_bias="0" | ||
app:layout_constraintStart_toStartOf="parent" | ||
app:layout_constraintTop_toTopOf="parent" /> | ||
|
||
<TextView | ||
android:id="@+id/lbs_paragraph_1_header" | ||
android:layout_width="0dp" | ||
android:layout_height="wrap_content" | ||
android:layout_marginStart="20dp" | ||
android:layout_marginTop="24dp" | ||
android:layout_marginEnd="20dp" | ||
android:text="@string/GroupsLearnMore_what_are_legacy_groups" | ||
android:textAppearance="@style/TextAppearance.Signal.Body2.Bold" | ||
android:textColor="?title_text_color_primary" | ||
app:layout_constraintBottom_toTopOf="@+id/lbs_paragraph_1" | ||
app:layout_constraintEnd_toEndOf="parent" | ||
app:layout_constraintHorizontal_bias="0" | ||
app:layout_constraintStart_toStartOf="parent" | ||
app:layout_constraintTop_toBottomOf="@+id/lbs_title" /> | ||
|
||
<TextView | ||
android:id="@+id/lbs_paragraph_1" | ||
android:layout_width="0dp" | ||
android:layout_height="wrap_content" | ||
android:layout_marginStart="20dp" | ||
android:layout_marginTop="4dp" | ||
android:layout_marginEnd="20dp" | ||
android:text="@string/GroupsLearnMore_paragraph_1" | ||
android:textAppearance="@style/TextAppearance.Signal.Body2" | ||
android:textColor="?title_text_color_secondary" | ||
app:layout_constraintBottom_toTopOf="@+id/lbs_paragraph_2_header" | ||
app:layout_constraintEnd_toEndOf="parent" | ||
app:layout_constraintHorizontal_bias="0" | ||
app:layout_constraintStart_toStartOf="parent" | ||
app:layout_constraintTop_toBottomOf="@+id/lbs_paragraph_1_header" /> | ||
|
||
<TextView | ||
android:id="@+id/lbs_paragraph_2_header" | ||
android:layout_width="0dp" | ||
android:layout_height="wrap_content" | ||
android:layout_marginStart="20dp" | ||
android:layout_marginTop="24dp" | ||
android:layout_marginEnd="20dp" | ||
android:text="@string/GroupsLearnMore_how_do_i_use_new_groups" | ||
android:textAppearance="@style/TextAppearance.Signal.Body2.Bold" | ||
android:textColor="?title_text_color_primary" | ||
app:layout_constraintBottom_toTopOf="@+id/lbs_paragraph_2_a" | ||
app:layout_constraintEnd_toEndOf="parent" | ||
app:layout_constraintHorizontal_bias="0" | ||
app:layout_constraintStart_toStartOf="parent" | ||
app:layout_constraintTop_toBottomOf="@+id/lbs_paragraph_1" /> | ||
|
||
<TextView | ||
android:id="@+id/lbs_paragraph_2_a" | ||
android:layout_width="0dp" | ||
android:layout_height="wrap_content" | ||
android:layout_marginStart="20dp" | ||
android:layout_marginTop="4dp" | ||
android:layout_marginEnd="20dp" | ||
android:text="@string/GroupsLearnMore_paragraph_2" | ||
android:textAppearance="@style/TextAppearance.Signal.Body2" | ||
android:textColor="?title_text_color_secondary" | ||
app:layout_constraintBottom_toTopOf="@+id/lbs_paragraph_2_b" | ||
app:layout_constraintEnd_toEndOf="parent" | ||
app:layout_constraintHorizontal_bias="0" | ||
app:layout_constraintStart_toStartOf="parent" | ||
app:layout_constraintTop_toBottomOf="@+id/lbs_paragraph_2_header" /> | ||
|
||
<TextView | ||
android:id="@+id/lbs_paragraph_2_b" | ||
android:layout_width="0dp" | ||
android:layout_height="wrap_content" | ||
android:layout_marginStart="20dp" | ||
android:layout_marginTop="20dp" | ||
android:layout_marginEnd="20dp" | ||
android:text="@string/GroupsLearnMore_paragraph_3" | ||
android:textAppearance="@style/TextAppearance.Signal.Body2.Bold" | ||
android:textColor="?title_text_color_secondary" | ||
app:layout_constraintBottom_toTopOf="@+id/lbs_paragraph_1" | ||
app:layout_constraintEnd_toEndOf="parent" | ||
app:layout_constraintHorizontal_bias="0" | ||
app:layout_constraintStart_toStartOf="parent" | ||
app:layout_constraintTop_toBottomOf="@+id/lbs_paragraph_2_a" /> | ||
|
||
<Button | ||
android:id="@+id/lbs_ok_button" | ||
style="@style/Button.Primary" | ||
android:layout_width="match_parent" | ||
android:layout_height="64dp" | ||
android:layout_marginStart="32dp" | ||
android:layout_marginTop="48dp" | ||
android:layout_marginEnd="32dp" | ||
android:layout_marginBottom="20dp" | ||
android:text="@android:string/ok" | ||
app:layout_constraintBottom_toBottomOf="parent" | ||
app:layout_constraintTop_toBottomOf="@+id/lbs_paragraph_2_b" | ||
app:layout_constraintVertical_bias="0" /> | ||
|
||
</androidx.constraintlayout.widget.ConstraintLayout> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.