forked from upstream-mirrors/quik
Add theme support to empty list indicator
This commit is contained in:
+20
-4
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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">
|
||||
|
||||
<com.moez.QKSMS.ui.view.QKImageView
|
||||
<ImageView
|
||||
android:id="@+id/empty_state_icon"
|
||||
android:layout_width="120dp"
|
||||
android:layout_height="120dp"
|
||||
android:src="@drawable/ic_chat" />
|
||||
|
||||
Reference in New Issue
Block a user