Search in sources :

Example 26 with CallSuper

use of android.support.annotation.CallSuper in project acra by ACRA.

the class CrashReportDialog method init.

@CallSuper
@Override
protected void init(@Nullable Bundle savedInstanceState) {
    scrollable = new LinearLayout(this);
    scrollable.setOrientation(LinearLayout.VERTICAL);
    sharedPreferencesFactory = new SharedPreferencesFactory(getApplicationContext(), getConfig());
    final int themeResourceId = getConfig().resDialogTheme();
    if (themeResourceId != ACRAConstants.DEFAULT_RES_VALUE)
        setTheme(themeResourceId);
    buildAndShowDialog(savedInstanceState);
}
Also used : SharedPreferencesFactory(org.acra.prefs.SharedPreferencesFactory) LinearLayout(android.widget.LinearLayout) CallSuper(android.support.annotation.CallSuper)

Example 27 with CallSuper

use of android.support.annotation.CallSuper in project wire-android by wireapp.

the class GlyphProgressView method init.

@CallSuper
protected void init() {
    strokeWidth = ViewUtils.toPx(getContext(), DEFAULT_STROKE_WIDTH_DP);
    progressPaint = new Paint();
    progressPaint.setStrokeWidth(strokeWidth);
    progressPaint.setAntiAlias(true);
    progressPaint.setStyle(Paint.Style.STROKE);
    updateRectF();
    startAngle = DEFAULT_START_ANGLE;
    setGravity(Gravity.CENTER);
}
Also used : Paint(android.graphics.Paint) CallSuper(android.support.annotation.CallSuper)

Example 28 with CallSuper

use of android.support.annotation.CallSuper in project android_frameworks_base by DirtyUnicorns.

the class BaseActivity method onPrepareOptionsMenu.

@Override
@CallSuper
public boolean onPrepareOptionsMenu(Menu menu) {
    super.onPrepareOptionsMenu(menu);
    mSearchManager.showMenu(canSearchRoot());
    final boolean inRecents = getCurrentDirectory() == null;
    final MenuItem sort = menu.findItem(R.id.menu_sort);
    final MenuItem sortSize = menu.findItem(R.id.menu_sort_size);
    final MenuItem grid = menu.findItem(R.id.menu_grid);
    final MenuItem list = menu.findItem(R.id.menu_list);
    final MenuItem advanced = menu.findItem(R.id.menu_advanced);
    final MenuItem fileSize = menu.findItem(R.id.menu_file_size);
    // Search uses backend ranking; no sorting, recents doesn't support sort.
    sort.setEnabled(!inRecents && !mSearchManager.isSearching());
    // Only sort by size when file sizes are visible
    sortSize.setVisible(mState.showSize);
    fileSize.setVisible(!mState.forceSize);
    // grid/list is effectively a toggle.
    grid.setVisible(mState.derivedMode != State.MODE_GRID);
    list.setVisible(mState.derivedMode != State.MODE_LIST);
    advanced.setVisible(mState.showAdvancedOption);
    advanced.setTitle(mState.showAdvancedOption && mState.showAdvanced ? R.string.menu_advanced_hide : R.string.menu_advanced_show);
    fileSize.setTitle(LocalPreferences.getDisplayFileSize(this) ? R.string.menu_file_size_hide : R.string.menu_file_size_show);
    return true;
}
Also used : MenuItem(android.view.MenuItem) CallSuper(android.support.annotation.CallSuper)

Example 29 with CallSuper

use of android.support.annotation.CallSuper in project android_frameworks_base by ResurrectionRemix.

the class BaseActivity method onPrepareOptionsMenu.

@Override
@CallSuper
public boolean onPrepareOptionsMenu(Menu menu) {
    super.onPrepareOptionsMenu(menu);
    mSearchManager.showMenu(canSearchRoot());
    final boolean inRecents = getCurrentDirectory() == null;
    final MenuItem sort = menu.findItem(R.id.menu_sort);
    final MenuItem sortSize = menu.findItem(R.id.menu_sort_size);
    final MenuItem grid = menu.findItem(R.id.menu_grid);
    final MenuItem list = menu.findItem(R.id.menu_list);
    final MenuItem advanced = menu.findItem(R.id.menu_advanced);
    final MenuItem fileSize = menu.findItem(R.id.menu_file_size);
    // Search uses backend ranking; no sorting, recents doesn't support sort.
    sort.setEnabled(!inRecents && !mSearchManager.isSearching());
    // Only sort by size when file sizes are visible
    sortSize.setVisible(mState.showSize);
    fileSize.setVisible(!mState.forceSize);
    // grid/list is effectively a toggle.
    grid.setVisible(mState.derivedMode != State.MODE_GRID);
    list.setVisible(mState.derivedMode != State.MODE_LIST);
    advanced.setVisible(mState.showAdvancedOption);
    advanced.setTitle(mState.showAdvancedOption && mState.showAdvanced ? R.string.menu_advanced_hide : R.string.menu_advanced_show);
    fileSize.setTitle(LocalPreferences.getDisplayFileSize(this) ? R.string.menu_file_size_hide : R.string.menu_file_size_show);
    return true;
}
Also used : MenuItem(android.view.MenuItem) CallSuper(android.support.annotation.CallSuper)

Example 30 with CallSuper

use of android.support.annotation.CallSuper in project android_frameworks_base by crdroidandroid.

the class BaseActivity method onCreate.

@CallSuper
@Override
public void onCreate(Bundle icicle) {
    // Record the time when onCreate is invoked for metric.
    mStartTime = new Date().getTime();
    super.onCreate(icicle);
    final Intent intent = getIntent();
    addListenerForLaunchCompletion();
    setContentView(mLayoutId);
    mDrawer = DrawerController.create(this);
    mState = getState(icicle);
    Metrics.logActivityLaunch(this, mState, intent);
    mRoots = DocumentsApplication.getRootsCache(this);
    getContentResolver().registerContentObserver(RootsCache.sNotificationUri, false, mRootsCacheObserver);
    mSearchManager = new SearchViewManager(this, icicle);
    DocumentsToolbar toolbar = (DocumentsToolbar) findViewById(R.id.toolbar);
    setActionBar(toolbar);
    mNavigator = new NavigationView(mDrawer, toolbar, (Spinner) findViewById(R.id.stack), mState, this);
    // Base classes must update result in their onCreate.
    setResult(Activity.RESULT_CANCELED);
}
Also used : Spinner(android.widget.Spinner) Intent(android.content.Intent) Date(java.util.Date) CallSuper(android.support.annotation.CallSuper)

Aggregations

CallSuper (android.support.annotation.CallSuper)30 Intent (android.content.Intent)6 MenuItem (android.view.MenuItem)6 View (android.view.View)5 Spinner (android.widget.Spinner)5 Date (java.util.Date)5 Bundle (android.os.Bundle)2 TextView (android.widget.TextView)2 SharedPreferences (android.content.SharedPreferences)1 ColorStateList (android.content.res.ColorStateList)1 Paint (android.graphics.Paint)1 Rect (android.graphics.Rect)1 StateListDrawable (android.graphics.drawable.StateListDrawable)1 ConnectivityManager (android.net.ConnectivityManager)1 NetworkInfo (android.net.NetworkInfo)1 PowerManager (android.os.PowerManager)1 RecognizerIntent (android.speech.RecognizerIntent)1 Nullable (android.support.annotation.Nullable)1 AppCompatActivity (android.support.v7.app.AppCompatActivity)1 MotionEvent (android.view.MotionEvent)1