当前位置: 首页>>代码示例>>Java>>正文


Java TLRPC.TL_disabledFeature方法代码示例

本文整理汇总了Java中org.telegram.tgnet.TLRPC.TL_disabledFeature方法的典型用法代码示例。如果您正苦于以下问题:Java TLRPC.TL_disabledFeature方法的具体用法?Java TLRPC.TL_disabledFeature怎么用?Java TLRPC.TL_disabledFeature使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.telegram.tgnet.TLRPC的用法示例。


在下文中一共展示了TLRPC.TL_disabledFeature方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: isFeatureEnabled

import org.telegram.tgnet.TLRPC; //导入方法依赖的package包/类
public static boolean isFeatureEnabled(String feature, BaseFragment fragment) {
    if (feature == null || feature.length() == 0 || getInstance().disabledFeatures.isEmpty() || fragment == null) {
        return true;
    }
    for (TLRPC.TL_disabledFeature disabledFeature : getInstance().disabledFeatures) {
        if (disabledFeature.feature.equals(feature)) {
            if (fragment.getParentActivity() != null) {
                AlertDialog.Builder builder = new AlertDialog.Builder(fragment.getParentActivity());
                builder.setTitle("Oops!");
                builder.setPositiveButton(LocaleController.getString("OK", R.string.OK), null);
                builder.setMessage(disabledFeature.description);
                fragment.showDialog(builder.create());
            }
            return false;
        }
    }
    return true;
}
 
开发者ID:MLNO,项目名称:airgram,代码行数:19,代码来源:MessagesController.java

示例2: MessagesController

import org.telegram.tgnet.TLRPC; //导入方法依赖的package包/类
public MessagesController() {
    controller=new MessageController();
    ImageLoader.getInstance();
    MessagesStorage.getInstance();
    NotificationCenter.getInstance().addObserver(this, NotificationCenter.FileDidUpload);
    NotificationCenter.getInstance().addObserver(this, NotificationCenter.FileDidFailUpload);
    NotificationCenter.getInstance().addObserver(this, NotificationCenter.FileDidLoaded);
    NotificationCenter.getInstance().addObserver(this, NotificationCenter.FileDidFailedLoad);
    NotificationCenter.getInstance().addObserver(this, NotificationCenter.messageReceivedByServer);
    addSupportUser();
    SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences("Notifications", Activity.MODE_PRIVATE);
    enableJoined = preferences.getBoolean("EnableContactJoined", true);

    preferences = ApplicationLoader.applicationContext.getSharedPreferences("mainconfig", Activity.MODE_PRIVATE);
    secretWebpagePreview = preferences.getInt("secretWebpage2", 2);
    maxGroupCount = preferences.getInt("maxGroupCount", 200);
    maxMegagroupCount = preferences.getInt("maxMegagroupCount", 1000);
    maxEditTime = preferences.getInt("maxEditTime", 3600);
    groupBigSize = preferences.getInt("groupBigSize", 10);
    ratingDecay = preferences.getInt("ratingDecay", 2419200);
    fontSize = preferences.getInt("fons_size", AndroidUtilities.isTablet() ? 18 : 16);
    String disabledFeaturesString = preferences.getString("disabledFeatures", null);
    if (disabledFeaturesString != null && disabledFeaturesString.length() != 0) {
        try {
            byte[] bytes = Base64.decode(disabledFeaturesString, Base64.DEFAULT);
            if (bytes != null) {
                SerializedData data = new SerializedData(bytes);
                int count = data.readInt32(false);
                for (int a = 0; a < count; a++) {
                    TLRPC.TL_disabledFeature feature = TLRPC.TL_disabledFeature.TLdeserialize(data, data.readInt32(false), false);
                    if (feature != null && feature.feature != null && feature.description != null) {
                        disabledFeatures.add(feature);
                    }
                }
            }
        } catch (Exception e) {
            FileLog.e("tmessages", e);
        }
    }
}
 
开发者ID:MLNO,项目名称:airgram,代码行数:41,代码来源:MessagesController.java

示例3: MessagesController

import org.telegram.tgnet.TLRPC; //导入方法依赖的package包/类
public MessagesController() {
    ImageLoader.getInstance();
    MessagesStorage.getInstance();
    NotificationCenter.getInstance().addObserver(this, NotificationCenter.FileDidUpload);
    NotificationCenter.getInstance().addObserver(this, NotificationCenter.FileDidFailUpload);
    NotificationCenter.getInstance().addObserver(this, NotificationCenter.FileDidLoaded);
    NotificationCenter.getInstance().addObserver(this, NotificationCenter.FileDidFailedLoad);
    NotificationCenter.getInstance().addObserver(this, NotificationCenter.messageReceivedByServer);
    addSupportUser();
    SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences("Notifications", Activity.MODE_PRIVATE);
    enableJoined = preferences.getBoolean("EnableContactJoined", true);

    //Telegram
    SharedPreferences Prefs = ApplicationLoader.applicationContext.getSharedPreferences("plusconfig", Activity.MODE_PRIVATE);
    hideLeftGroup = Prefs.getBoolean("hideLeftGroup", false);
    hideJoinedGroup = Prefs.getBoolean("hideJoinedGroup", false);
    //

    preferences = ApplicationLoader.applicationContext.getSharedPreferences("mainconfig", Activity.MODE_PRIVATE);
    secretWebpagePreview = preferences.getInt("secretWebpage2", 2);
    maxGroupCount = preferences.getInt("maxGroupCount", 200);
    maxMegagroupCount = preferences.getInt("maxMegagroupCount", 1000);
    maxRecentGifsCount = preferences.getInt("maxRecentGifsCount", 200);
    maxRecentStickersCount = preferences.getInt("maxRecentStickersCount", 30);
    maxEditTime = preferences.getInt("maxEditTime", 3600);
    groupBigSize = preferences.getInt("groupBigSize", 10);
    ratingDecay = preferences.getInt("ratingDecay", 2419200);
    fontSize = preferences.getInt("fons_size", AndroidUtilities.isTablet() ? 18 : 16);
    allowBigEmoji = preferences.getBoolean("allowBigEmoji", false);
    useSystemEmoji = preferences.getBoolean("useSystemEmoji", false);
    String disabledFeaturesString = preferences.getString("disabledFeatures", null);
    if (disabledFeaturesString != null && disabledFeaturesString.length() != 0) {
        try {

            byte[] bytes = Base64.decode(disabledFeaturesString, Base64.DEFAULT);
            if (bytes != null) {
                SerializedData data = new SerializedData(bytes);
                int count = data.readInt32(false);
                for (int a = 0; a < count; a++) {
                    TLRPC.TL_disabledFeature feature = TLRPC.TL_disabledFeature.TLdeserialize(data, data.readInt32(false), false);
                    if (feature != null && feature.feature != null && feature.description != null) {
                        disabledFeatures.add(feature);
                    }
                }
            }
        } catch (Exception e) {
            FileLog.e("tmessages", e);
        }
    }
}
 
开发者ID:pooyafaroka,项目名称:PlusGram,代码行数:51,代码来源:MessagesController.java


注:本文中的org.telegram.tgnet.TLRPC.TL_disabledFeature方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。