Search in sources :

Example 1 with ConversationDetailsDialog

use of com.moez.QKSMS.ui.dialog.conversationdetails.ConversationDetailsDialog in project qksms by moezbhatti.

the class MessageListFragment method onCreate.

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    if (getArguments() != null) {
        Bundle args = getArguments();
        mThreadId = args.getLong(MessageListActivity.ARG_THREAD_ID, -1);
        mRowId = args.getLong(MessageListActivity.ARG_ROW_ID, -1);
        mHighlight = args.getString(MessageListActivity.ARG_HIGHLIGHT, null);
        mShowImmediate = args.getBoolean(MessageListActivity.ARG_SHOW_IMMEDIATE, false);
    } else if (savedInstanceState != null) {
        mThreadId = savedInstanceState.getLong(MessageListActivity.ARG_THREAD_ID, -1);
        mRowId = savedInstanceState.getLong(MessageListActivity.ARG_ROW_ID, -1);
        mHighlight = savedInstanceState.getString(MessageListActivity.ARG_HIGHLIGHT, null);
        mShowImmediate = savedInstanceState.getBoolean(MessageListActivity.ARG_SHOW_IMMEDIATE, false);
    }
    mConversationPrefs = new ConversationPrefsHelper(mContext, mThreadId);
    mIsSmsEnabled = MmsConfig.isSmsEnabled(mContext);
    mConversationDetailsDialog = new ConversationDetailsDialog(mContext, getFragmentManager());
    onOpenConversation();
    setHasOptionsMenu(true);
    LiveViewManager.registerView(QKPreference.CONVERSATION_THEME, this, key -> {
        mCIELChEvaluator = new CIELChEvaluator(mConversationPrefs.getColor(), ThemeManager.getThemeColor());
    });
    mSensorManager = (SensorManager) mContext.getSystemService(Context.SENSOR_SERVICE);
    mProxSensor = mSensorManager.getDefaultSensor(Sensor.TYPE_PROXIMITY);
    if (QKPreferences.getBoolean(QKPreference.PROXIMITY_SENSOR)) {
        mSensorManager.registerListener(this, mProxSensor, SensorManager.SENSOR_DELAY_NORMAL);
    }
    mBackgroundQueryHandler = new BackgroundQueryHandler(mContext.getContentResolver());
}
Also used : CIELChEvaluator(com.moez.QKSMS.common.CIELChEvaluator) Bundle(android.os.Bundle) ConversationDetailsDialog(com.moez.QKSMS.ui.dialog.conversationdetails.ConversationDetailsDialog) ConversationPrefsHelper(com.moez.QKSMS.common.ConversationPrefsHelper)

Example 2 with ConversationDetailsDialog

use of com.moez.QKSMS.ui.dialog.conversationdetails.ConversationDetailsDialog in project qksms by moezbhatti.

the class ConversationListFragment method onCreate.

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    mPrefs = PreferenceManager.getDefaultSharedPreferences(mContext);
    setHasOptionsMenu(true);
    mAdapter = new ConversationListAdapter(mContext);
    mAdapter.setItemClickListener(this);
    mAdapter.setMultiSelectListener(this);
    mLayoutManager = new LinearLayoutManager(mContext);
    mConversationDetailsDialog = new ConversationDetailsDialog(mContext, getFragmentManager());
    LiveViewManager.registerView(QKPreference.THEME, this, key -> {
        if (!mViewHasLoaded) {
            return;
        }
        mFab.setColorNormal(ThemeManager.getColor());
        mFab.setColorPressed(ColorUtils.lighten(ThemeManager.getColor()));
        mFab.getDrawable().setColorFilter(ThemeManager.getTextOnColorPrimary(), PorterDuff.Mode.SRC_ATOP);
        mEmptyStateIcon.setColorFilter(ThemeManager.getTextOnBackgroundPrimary());
    });
}
Also used : ConversationDetailsDialog(com.moez.QKSMS.ui.dialog.conversationdetails.ConversationDetailsDialog) LinearLayoutManager(android.support.v7.widget.LinearLayoutManager)

Aggregations

ConversationDetailsDialog (com.moez.QKSMS.ui.dialog.conversationdetails.ConversationDetailsDialog)2 Bundle (android.os.Bundle)1 LinearLayoutManager (android.support.v7.widget.LinearLayoutManager)1 CIELChEvaluator (com.moez.QKSMS.common.CIELChEvaluator)1 ConversationPrefsHelper (com.moez.QKSMS.common.ConversationPrefsHelper)1