Messaging: Implement option for swipe right to delete.
Squashed commit of the following: Author: Adnan Begovic <adnan@cyngn.com> Date: Thu Jan 14 17:20:43 2016 -0800 Messaging: Implement option for swipe to delete. No one wants to swipe to archive, that's stupid. Change-Id: Ia8f0fc675582ef343311e60b755e284322f25102 Author: chengzhi.hou <chengzhi.hou@ck-telecom.com> Date: Wed Feb 24 20:01:17 2016 +0800 Messaging: Swipe right to delete conversation Change "swipe delete" to "swipe right delete", so SwipeArchive and SwipeDelete can exist at the same time. Change-Id: Id66167c2e749f8ab0ee917e0138027c7404b8c90 Author: Michael Bestas <mikeioannina@cyanogenmod.org> Date: Tue Mar 1 02:27:16 2016 +0200 Improve swipe to delete strings Change-Id: I180d09a6680084d9fd87c6dafd56db18ca5a580a Author: Joey Rizzoli <joey@cyanogenmoditalia.it> Date: Mon Oct 17 16:32:25 2016 +0200 Messaging: show snackbar instead of toast when deleting conversation more consistency with archive action Change-Id: I06129850860a2a51c10ade65fb87c9f37a0c2bfa Signed-off-by: Joey Rizzoli <joey@cyanogenmoditalia.it> Change-Id: Ia8f0fc675582ef343311e60b755e284322f25102
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
/*
|
||||
* Copyright (C) 2016 The CyanogenMod Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.lineageos.messaging.util;
|
||||
|
||||
import android.content.Context;
|
||||
import com.android.messaging.Factory;
|
||||
import com.android.messaging.R;
|
||||
import com.android.messaging.util.BuglePrefs;
|
||||
|
||||
public class PrefsUtils {
|
||||
private PrefsUtils() {
|
||||
//Don't instantiate
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns whether or not swipe to dismiss in the ConversationListFragment deletes
|
||||
* the conversation rather than archiving it.
|
||||
* @return hopefully true
|
||||
*/
|
||||
public static boolean isSwipeRightToDeleteEnabled() {
|
||||
final BuglePrefs prefs = BuglePrefs.getApplicationPrefs();
|
||||
final Context context = Factory.get().getApplicationContext();
|
||||
final String prefKey = context.getString(R.string.swipe_right_deletes_conversation_key);
|
||||
final boolean defaultValue = context.getResources().getBoolean(
|
||||
R.bool.swipe_right_deletes_conversation_default);
|
||||
return prefs.getBoolean(prefKey, defaultValue);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user