From c0f015ca7a36e7dd8816536faf62d12f1f160bdf Mon Sep 17 00:00:00 2001 From: Moez Bhatti Date: Thu, 29 Oct 2015 23:39:53 -0400 Subject: [PATCH 1/6] Added views to show behind RecyclerView --- .../res/layout/fragment_conversations.xml | 22 ++++++++++++++++--- QKSMS/src/main/res/values/strings.xml | 1 + 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/QKSMS/src/main/res/layout/fragment_conversations.xml b/QKSMS/src/main/res/layout/fragment_conversations.xml index ec04e805..b7f90abd 100644 --- a/QKSMS/src/main/res/layout/fragment_conversations.xml +++ b/QKSMS/src/main/res/layout/fragment_conversations.xml @@ -1,9 +1,25 @@ - + + + + + + diff --git a/QKSMS/src/main/res/values/strings.xml b/QKSMS/src/main/res/values/strings.xml index 3b89fad0..10c525a6 100644 --- a/QKSMS/src/main/res/values/strings.xml +++ b/QKSMS/src/main/res/values/strings.xml @@ -731,6 +731,7 @@ Yesterday Just now Loading attachment + No messages yet.\nClick the + to send one! Resend From 75f90082e11af5851d693a1fcdda066393b02386 Mon Sep 17 00:00:00 2001 From: Moez Bhatti Date: Thu, 29 Oct 2015 23:45:51 -0400 Subject: [PATCH 2/6] Updated gradle for vector asset support --- build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build.gradle b/build.gradle index e51aef8b..954406a4 100644 --- a/build.gradle +++ b/build.gradle @@ -1,8 +1,8 @@ buildscript { repositories { - mavenCentral() + jcenter() } dependencies { - classpath 'com.android.tools.build:gradle:1.3.1' + classpath 'com.android.tools.build:gradle:1.4.0-beta3' } } From 2e0736326d48b3d8e5addae60761dd623a86eed3 Mon Sep 17 00:00:00 2001 From: Moez Bhatti Date: Thu, 29 Oct 2015 23:50:24 -0400 Subject: [PATCH 3/6] Added chat asset --- QKSMS/src/main/res/drawable/ic_chat.xml | 11 +++++++++++ QKSMS/src/main/res/layout/fragment_conversations.xml | 9 ++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 QKSMS/src/main/res/drawable/ic_chat.xml diff --git a/QKSMS/src/main/res/drawable/ic_chat.xml b/QKSMS/src/main/res/drawable/ic_chat.xml new file mode 100644 index 00000000..98255982 --- /dev/null +++ b/QKSMS/src/main/res/drawable/ic_chat.xml @@ -0,0 +1,11 @@ + + + + diff --git a/QKSMS/src/main/res/layout/fragment_conversations.xml b/QKSMS/src/main/res/layout/fragment_conversations.xml index b7f90abd..249cb289 100644 --- a/QKSMS/src/main/res/layout/fragment_conversations.xml +++ b/QKSMS/src/main/res/layout/fragment_conversations.xml @@ -9,7 +9,14 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centerInParent="true" - android:gravity="center"> + android:gravity="center" + android:orientation="vertical" + android:paddingBottom="32dp"> + + Date: Fri, 30 Oct 2015 00:14:27 -0400 Subject: [PATCH 4/6] Add theme support to empty list indicator --- .../ConversationListFragment.java | 24 +++++++++++++++---- .../res/layout/fragment_conversations.xml | 4 +++- 2 files changed, 23 insertions(+), 5 deletions(-) diff --git a/QKSMS/src/main/java/com/moez/QKSMS/ui/conversationlist/ConversationListFragment.java b/QKSMS/src/main/java/com/moez/QKSMS/ui/conversationlist/ConversationListFragment.java index 5a93bdc6..7fd229b6 100644 --- a/QKSMS/src/main/java/com/moez/QKSMS/ui/conversationlist/ConversationListFragment.java +++ b/QKSMS/src/main/java/com/moez/QKSMS/ui/conversationlist/ConversationListFragment.java @@ -20,6 +20,8 @@ import android.view.MenuItem; import android.view.View; import android.view.ViewGroup; import android.widget.AdapterView; +import android.widget.ImageView; + import com.melnykov.fab.FloatingActionButton; import com.moez.QKSMS.R; import com.moez.QKSMS.common.BlockedConversationHelper; @@ -60,6 +62,8 @@ public class ConversationListFragment extends QKFragment implements LoaderManage private final int MENU_BLOCK_CONVERSATION = 9; private final int MENU_UNBLOCK_CONVERSATION = 10; + private View mEmptyState; + private ImageView mEmptyStateIcon; private RecyclerView mRecyclerView; private FloatingActionButton mFab; private ConversationListAdapter mAdapter; @@ -69,6 +73,8 @@ public class ConversationListFragment extends QKFragment implements LoaderManage private MenuItem mBlockedItem; private boolean mShowBlocked = false; + private boolean mViewHasLoaded = false; + // This does not hold the current position of the list, rather the position the list is pending being set to private int mPosition; @@ -93,6 +99,10 @@ public class ConversationListFragment extends QKFragment implements LoaderManage public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.inflate(R.layout.fragment_conversations, null); + mEmptyState = view.findViewById(R.id.empty_state); + mEmptyStateIcon = (ImageView) view.findViewById(R.id.empty_state_icon); + mEmptyStateIcon.setColorFilter(ThemeManager.getTextOnBackgroundPrimary()); + mRecyclerView = (RecyclerView) view.findViewById(R.id.conversations_list); mRecyclerView.setHasFixedSize(true); mRecyclerView.setLayoutManager(mLayoutManager); @@ -117,6 +127,8 @@ public class ConversationListFragment extends QKFragment implements LoaderManage } }); + mViewHasLoaded = true; + initLoaderManager(); return view; @@ -347,12 +359,16 @@ public class ConversationListFragment extends QKFragment implements LoaderManage @Override public void refresh() { - if (mFab != null) { - mFab.setColorNormal(ThemeManager.getColor()); - mFab.setColorPressed(ColorUtils.lighten(ThemeManager.getColor())); - mFab.getDrawable().setColorFilter(new PorterDuffColorFilter(ThemeManager.getTextOnColorPrimary(), PorterDuff.Mode.MULTIPLY)); + if (!mViewHasLoaded) { + return; } + mFab.setColorNormal(ThemeManager.getColor()); + mFab.setColorPressed(ColorUtils.lighten(ThemeManager.getColor())); + mFab.getDrawable().setColorFilter(new PorterDuffColorFilter(ThemeManager.getTextOnColorPrimary(), PorterDuff.Mode.MULTIPLY)); + + mEmptyStateIcon.setColorFilter(ThemeManager.getTextOnBackgroundPrimary()); + //TODO ListviewHelper.applyCustomScrollbar(mContext, mListView); } diff --git a/QKSMS/src/main/res/layout/fragment_conversations.xml b/QKSMS/src/main/res/layout/fragment_conversations.xml index 249cb289..a8bcb930 100644 --- a/QKSMS/src/main/res/layout/fragment_conversations.xml +++ b/QKSMS/src/main/res/layout/fragment_conversations.xml @@ -9,11 +9,13 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centerInParent="true" + android:alpha="0.5" android:gravity="center" android:orientation="vertical" android:paddingBottom="32dp"> - From 26e9f2d8cb913e30769c4220b4ede913e88ac658 Mon Sep 17 00:00:00 2001 From: Moez Bhatti Date: Fri, 30 Oct 2015 00:21:31 -0400 Subject: [PATCH 5/6] Fix visibility of empty state --- .../QKSMS/ui/conversationlist/ConversationListFragment.java | 4 +++- QKSMS/src/main/res/layout/fragment_conversations.xml | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/QKSMS/src/main/java/com/moez/QKSMS/ui/conversationlist/ConversationListFragment.java b/QKSMS/src/main/java/com/moez/QKSMS/ui/conversationlist/ConversationListFragment.java index 7fd229b6..87e0fc57 100644 --- a/QKSMS/src/main/java/com/moez/QKSMS/ui/conversationlist/ConversationListFragment.java +++ b/QKSMS/src/main/java/com/moez/QKSMS/ui/conversationlist/ConversationListFragment.java @@ -349,6 +349,8 @@ public class ConversationListFragment extends QKFragment implements LoaderManage mPosition = 0; } } + + mEmptyState.setVisibility(data != null && data.getCount() > 0 ? View.GONE : View.VISIBLE); } public void onLoaderReset(Loader loader) { @@ -366,7 +368,7 @@ public class ConversationListFragment extends QKFragment implements LoaderManage mFab.setColorNormal(ThemeManager.getColor()); mFab.setColorPressed(ColorUtils.lighten(ThemeManager.getColor())); mFab.getDrawable().setColorFilter(new PorterDuffColorFilter(ThemeManager.getTextOnColorPrimary(), PorterDuff.Mode.MULTIPLY)); - + mEmptyStateIcon.setColorFilter(ThemeManager.getTextOnBackgroundPrimary()); //TODO ListviewHelper.applyCustomScrollbar(mContext, mListView); diff --git a/QKSMS/src/main/res/layout/fragment_conversations.xml b/QKSMS/src/main/res/layout/fragment_conversations.xml index a8bcb930..3bad8f1d 100644 --- a/QKSMS/src/main/res/layout/fragment_conversations.xml +++ b/QKSMS/src/main/res/layout/fragment_conversations.xml @@ -12,7 +12,8 @@ android:alpha="0.5" android:gravity="center" android:orientation="vertical" - android:paddingBottom="32dp"> + android:paddingBottom="32dp" + android:visibility="gone"> Date: Fri, 30 Oct 2015 00:54:37 -0400 Subject: [PATCH 6/6] Updated travis script --- .travis.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 764b0107..77f359be 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,4 +18,6 @@ android: - extra-google-m2repository - extra-android-m2repository -script: "./gradlew build" +script: + - ./gradlew clean + - ./gradlew build