mirror of
https://github.com/quik-sms/quik.git
synced 2026-11-20 20:58:54 +01:00
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.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
import android.widget.AdapterView;
|
import android.widget.AdapterView;
|
||||||
|
import android.widget.ImageView;
|
||||||
|
|
||||||
import com.melnykov.fab.FloatingActionButton;
|
import com.melnykov.fab.FloatingActionButton;
|
||||||
import com.moez.QKSMS.R;
|
import com.moez.QKSMS.R;
|
||||||
import com.moez.QKSMS.common.BlockedConversationHelper;
|
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_BLOCK_CONVERSATION = 9;
|
||||||
private final int MENU_UNBLOCK_CONVERSATION = 10;
|
private final int MENU_UNBLOCK_CONVERSATION = 10;
|
||||||
|
|
||||||
|
private View mEmptyState;
|
||||||
|
private ImageView mEmptyStateIcon;
|
||||||
private RecyclerView mRecyclerView;
|
private RecyclerView mRecyclerView;
|
||||||
private FloatingActionButton mFab;
|
private FloatingActionButton mFab;
|
||||||
private ConversationListAdapter mAdapter;
|
private ConversationListAdapter mAdapter;
|
||||||
@@ -69,6 +73,8 @@ public class ConversationListFragment extends QKFragment implements LoaderManage
|
|||||||
private MenuItem mBlockedItem;
|
private MenuItem mBlockedItem;
|
||||||
private boolean mShowBlocked = false;
|
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
|
// This does not hold the current position of the list, rather the position the list is pending being set to
|
||||||
private int mPosition;
|
private int mPosition;
|
||||||
|
|
||||||
@@ -93,6 +99,10 @@ public class ConversationListFragment extends QKFragment implements LoaderManage
|
|||||||
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||||
View view = inflater.inflate(R.layout.fragment_conversations, null);
|
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 = (RecyclerView) view.findViewById(R.id.conversations_list);
|
||||||
mRecyclerView.setHasFixedSize(true);
|
mRecyclerView.setHasFixedSize(true);
|
||||||
mRecyclerView.setLayoutManager(mLayoutManager);
|
mRecyclerView.setLayoutManager(mLayoutManager);
|
||||||
@@ -117,6 +127,8 @@ public class ConversationListFragment extends QKFragment implements LoaderManage
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
mViewHasLoaded = true;
|
||||||
|
|
||||||
initLoaderManager();
|
initLoaderManager();
|
||||||
|
|
||||||
return view;
|
return view;
|
||||||
@@ -347,12 +359,16 @@ public class ConversationListFragment extends QKFragment implements LoaderManage
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void refresh() {
|
public void refresh() {
|
||||||
if (mFab != null) {
|
if (!mViewHasLoaded) {
|
||||||
mFab.setColorNormal(ThemeManager.getColor());
|
return;
|
||||||
mFab.setColorPressed(ColorUtils.lighten(ThemeManager.getColor()));
|
|
||||||
mFab.getDrawable().setColorFilter(new PorterDuffColorFilter(ThemeManager.getTextOnColorPrimary(), PorterDuff.Mode.MULTIPLY));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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);
|
//TODO ListviewHelper.applyCustomScrollbar(mContext, mListView);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -9,11 +9,13 @@
|
|||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_centerInParent="true"
|
android:layout_centerInParent="true"
|
||||||
|
android:alpha="0.5"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:paddingBottom="32dp">
|
android:paddingBottom="32dp">
|
||||||
|
|
||||||
<com.moez.QKSMS.ui.view.QKImageView
|
<ImageView
|
||||||
|
android:id="@+id/empty_state_icon"
|
||||||
android:layout_width="120dp"
|
android:layout_width="120dp"
|
||||||
android:layout_height="120dp"
|
android:layout_height="120dp"
|
||||||
android:src="@drawable/ic_chat" />
|
android:src="@drawable/ic_chat" />
|
||||||
|
|||||||
Reference in New Issue
Block a user