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


Java ActivityUtils类代码示例

本文整理汇总了Java中net.gsantner.opoc.util.ActivityUtils的典型用法代码示例。如果您正苦于以下问题:Java ActivityUtils类的具体用法?Java ActivityUtils怎么用?Java ActivityUtils使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: onViewCreated

import net.gsantner.opoc.util.ActivityUtils; //导入依赖的package包/类
@Override
public void onViewCreated(@NonNull View view, Bundle savedInstanceState) {
    //applyTextFormat(TextFormat.FORMAT_PLAIN);
    setupAppearancePreferences();

    if (savedInstanceState != null && savedInstanceState.containsKey(SAVESTATE_DOCUMENT)) {
        _document = (Document) savedInstanceState.getSerializable(SAVESTATE_DOCUMENT);
    }
    _document = loadDocument();
    loadDocumentIntoUi();
    if (savedInstanceState != null && savedInstanceState.containsKey(SAVESTATE_CURSOR_POS)) {
        int cursor = savedInstanceState.getInt(SAVESTATE_CURSOR_POS);
        if (cursor >= 0 && cursor < _hlEditor.length()) {
            _hlEditor.setSelection(cursor);
        }
    }

    new ActivityUtils(getActivity()).hideSoftKeyboard();
    AppSettings appSettings = new AppSettings(_context);
    _hlEditor.clearFocus();
    _hlEditor.setLineSpacing(0, appSettings.getEditorLineSpacing());
}
 
开发者ID:gsantner,项目名称:markor,代码行数:23,代码来源:DocumentEditFragment.java

示例2: onClick

import net.gsantner.opoc.util.ActivityUtils; //导入依赖的package包/类
@OnClick({R.id.more__fragment__action_about, R.id.more__fragment__action_contribute, R.id.more__fragment__action_donate, R.id.more__fragment__action_settings})
public void onClick(View view) {
    ActivityUtils au = new ActivityUtils(getActivity());
    switch (view.getId()) {
        case R.id.more__fragment__action_settings: {
            au.animateToActivity(SettingsActivity.class, false, 124);
            break;
        }
        case R.id.more__fragment__action_about: {
            au.animateToActivity(AboutActivity.class, false, 123);
            break;
        }
        case R.id.more__fragment__action_donate: {
            au.openWebpageInExternalBrowser(getString(R.string.url_donate));
            break;
        }
        case R.id.more__fragment__action_contribute: {
            au.openWebpageInExternalBrowser(getString(R.string.url_contribute));
            break;
        }
    }
}
 
开发者ID:gsantner,项目名称:markor,代码行数:23,代码来源:MoreFragment.java

示例3: checkPermissionResult

import net.gsantner.opoc.util.ActivityUtils; //导入依赖的package包/类
public static boolean checkPermissionResult(final Activity activity, int requestCode, String[] permissions, int[] grantResults) {
    if (requestCode == 314) {
        if (grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) {
            return true;
        }
    }
    new ActivityUtils(activity).showSnackBar(R.string.error_storage_permission, true);
    return false;
}
 
开发者ID:gsantner,项目名称:markor,代码行数:10,代码来源:PermissionChecker.java

示例4: mkSaveDir

import net.gsantner.opoc.util.ActivityUtils; //导入依赖的package包/类
public static boolean mkSaveDir(Activity activity) {
    File saveDir = AppSettings.get().getNotebookDirectory();
    if (!saveDir.exists() && !saveDir.mkdirs()) {
        new ActivityUtils(activity).showSnackBar(R.string.error_cannot_create_notebook_dir, false);
        return false;
    }
    return true;
}
 
开发者ID:gsantner,项目名称:markor,代码行数:9,代码来源:PermissionChecker.java

示例5: handleBarClick

import net.gsantner.opoc.util.ActivityUtils; //导入依赖的package包/类
public boolean handleBarClick(MenuItem item) {
    switch (item.getItemId()) {
        case R.id.action_settings: {
            new ActivityUtils(this).animateToActivity(SettingsActivity.class, false, null);
            return true;
        }
        case R.id.action_login: {
            loadWebapp(true);
            return true;
        }
        case R.id.action_info: {
            startActivity(new Intent(this, AboutActivity.class));
            return true;
        }
        case R.id.action_exit: {
            webView.clearCache(true);
            webView.clearFormData();
            webView.clearHistory();
            webView.clearMatches();
            webView.clearSslPreferences();
            finish();
            if (getResources().getBoolean(R.bool.should_exit_with_system_too)) {
                System.exit(0);
            }
            return true;
        }
        case R.id.action_reload: {

            WindowManager.LayoutParams attrs = getWindow().getAttributes();
            attrs.flags ^= WindowManager.LayoutParams.FLAG_FULLSCREEN;
            getWindow().setAttributes(attrs);
            webView.reload();
            return true;
        }
        case R.id.action_donate: {
            ContextUtils.get().openWebpageInExternalBrowser(getString(R.string.donate__url));
            return true;
        }
        case R.id.action_homepage_additional: {
            ContextUtils.get().openWebpageInExternalBrowser(getString(R.string.page_additional_homepage));
            return true;
        }
        case R.id.action_homepage_author: {
            ContextUtils.get().openWebpageInExternalBrowser(getString(R.string.page_author));
            return true;
        }
    }
    return false;
}
 
开发者ID:gsantner,项目名称:cherrymusic-android,代码行数:50,代码来源:MainActivity.java


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