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 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..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 @@ -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; @@ -337,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) { @@ -347,12 +361,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/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 ec04e805..3bad8f1d 100644 --- a/QKSMS/src/main/res/layout/fragment_conversations.xml +++ b/QKSMS/src/main/res/layout/fragment_conversations.xml @@ -1,9 +1,35 @@ - + + + + + + + + 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 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' } }