Add a gradient and background to the onboarding megaphone.

This commit is contained in:
Greyson Parrelli 2021-01-10 10:53:22 -05:00 committed by Alan Evans
parent 5d515198e6
commit e6dfe96569
5 changed files with 54 additions and 22 deletions

View file

@ -81,7 +81,7 @@ public class ConversationListArchiveFragment extends ConversationListFragment im
} }
@Override @Override
protected void onPostSubmitList() { protected void onPostSubmitList(int conversationCount) {
list.setVisibility(View.VISIBLE); list.setVisibility(View.VISIBLE);
if (emptyState.resolved()) { if (emptyState.resolved()) {
@ -148,6 +148,11 @@ public class ConversationListArchiveFragment extends ConversationListFragment im
} }
}.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, threadId); }.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, threadId);
} }
@Override
void updateEmptyState(boolean isConversationEmpty) {
// Do nothing
}
} }

View file

@ -832,10 +832,10 @@ public class ConversationListFragment extends MainFragment implements ActionMode
private void onSubmitList(@NonNull List<Conversation> conversationList) { private void onSubmitList(@NonNull List<Conversation> conversationList) {
defaultAdapter.submitList(conversationList); defaultAdapter.submitList(conversationList);
onPostSubmitList(); onPostSubmitList(conversationList.size());
} }
private void updateEmptyState(boolean isConversationEmpty) { void updateEmptyState(boolean isConversationEmpty) {
if (isConversationEmpty) { if (isConversationEmpty) {
Log.i(TAG, "Received an empty data set."); Log.i(TAG, "Received an empty data set.");
list.setVisibility(View.INVISIBLE); list.setVisibility(View.INVISIBLE);
@ -856,7 +856,11 @@ public class ConversationListFragment extends MainFragment implements ActionMode
} }
} }
protected void onPostSubmitList() { protected void onPostSubmitList(int conversationCount) {
if (conversationCount >= 6 && (SignalStore.onboarding().shouldShowInviteFriends() || SignalStore.onboarding().shouldShowNewGroup())) {
SignalStore.onboarding().clearAll();
ApplicationDependencies.getMegaphoneRepository().markFinished(Megaphones.Event.ONBOARDING);
}
} }
@Override @Override

View file

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<gradient
android:type="linear"
android:angle="90"
android:startColor="@color/signal_background_primary"
android:endColor="@color/signal_transparent" />
</shape>

View file

@ -139,7 +139,7 @@
android:clipToPadding="false" android:clipToPadding="false"
android:nextFocusDown="@+id/fab" android:nextFocusDown="@+id/fab"
android:nextFocusForward="@+id/fab" android:nextFocusForward="@+id/fab"
android:paddingBottom="150dp" android:paddingBottom="160dp"
android:scrollbars="vertical" android:scrollbars="vertical"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toBottomOf="@id/reminder" app:layout_constraintTop_toBottomOf="@id/reminder"

View file

@ -5,38 +5,53 @@
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:paddingBottom="14dp" android:paddingBottom="10dp"
android:clipChildren="false" android:clipChildren="false"
android:clipToPadding="false" android:clipToPadding="false"
tools:parentTag="android.widget.FrameLayout"> tools:parentTag="android.widget.FrameLayout">
<androidx.constraintlayout.widget.ConstraintLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:paddingBottom="12dp" android:orientation="vertical"
android:clipToPadding="false" android:clipToPadding="false"
android:clipChildren="false"> android:clipChildren="false">
<TextView <ImageView
android:id="@+id/onboarding_megaphone_title"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="24dp"
android:layout_marginStart="16dp" android:src="@drawable/megaphone_onboarding_gradient" />
style="@style/TextAppearance.Signal.Title2"
android:text="@string/Megaphones_get_started"
app:layout_constraintTop_toTopOf="parent" />
<androidx.recyclerview.widget.RecyclerView <androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/onboarding_megaphone_list"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="16dp" android:paddingBottom="12dp"
android:layout_marginTop="10dp"
android:clipChildren="false"
android:clipToPadding="false" android:clipToPadding="false"
app:layout_constraintTop_toBottomOf="@id/onboarding_megaphone_title"/> android:clipChildren="false"
android:background="@color/signal_background_primary">
</androidx.constraintlayout.widget.ConstraintLayout> <TextView
android:id="@+id/onboarding_megaphone_title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="4dp"
style="@style/TextAppearance.Signal.Title2"
android:text="@string/Megaphones_get_started"
app:layout_constraintTop_toTopOf="parent" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/onboarding_megaphone_list"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="10dp"
android:clipChildren="false"
android:clipToPadding="false"
app:layout_constraintTop_toBottomOf="@id/onboarding_megaphone_title"/>
</androidx.constraintlayout.widget.ConstraintLayout>
</LinearLayout>
</merge> </merge>