net.gsantner.opoc.util.ActivityUtils Java Examples

The following examples show how to use net.gsantner.opoc.util.ActivityUtils. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: GsPreferenceFragmentCompat.java    From memetastic with GNU General Public License v3.0 5 votes vote down vote up
public Integer getDividerColor() {
    ActivityUtils au = new ActivityUtils(getActivity());
    try {
        return Color.parseColor(au.shouldColorOnTopBeLight(au.getActivityBackgroundColor()) ? "#3d3d3d" : "#d1d1d1");
    } catch (Exception ignored) {
        return null;
    } finally {
        au.freeContextRef();
    }
}
 
Example #2
Source File: GsPreferenceFragmentCompat.java    From openlauncher with Apache License 2.0 5 votes vote down vote up
public Integer getDividerColor() {
    ActivityUtils au = new ActivityUtils(getActivity());
    try {
        return Color.parseColor(au.shouldColorOnTopBeLight(au.getActivityBackgroundColor()) ? "#3d3d3d" : "#d1d1d1");
    } catch (Exception ignored) {
        return null;
    } finally {
        au.freeContextRef();
    }
}
 
Example #3
Source File: GsPreferenceFragmentCompat.java    From kimai-android with MIT License 5 votes vote down vote up
public Integer getDividerColor() {
    ActivityUtils au = new ActivityUtils(getActivity());
    try {
        return Color.parseColor(au.shouldColorOnTopBeLight(au.getActivityBackgroundColor()) ? "#3d3d3d" : "#d1d1d1");
    } catch (Exception ignored) {
        return null;
    } finally {
        au.freeContextRef();
    }
}
 
Example #4
Source File: HpSearchBar.java    From openlauncher with Apache License 2.0 4 votes vote down vote up
@Override
public void onClick(View v) {
    new ActivityUtils(_homeActivity).startCalendarApp().freeContextRef();
}
 
Example #5
Source File: MainActivity.java    From kimai-android with MIT License 4 votes vote down vote up
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;
}