Search in sources :

Example 21 with ActionBar

use of android.app.ActionBar in project frostwire by frostwire.

the class MainActivity method setupActionBar.

private void setupActionBar() {
    ActionBar bar = getActionBar();
    if (bar != null) {
        bar.setCustomView(R.layout.view_custom_actionbar);
        bar.setDisplayShowCustomEnabled(true);
        bar.setDisplayHomeAsUpEnabled(true);
        bar.setHomeButtonEnabled(true);
    }
}
Also used : ActionBar(android.app.ActionBar)

Example 22 with ActionBar

use of android.app.ActionBar in project android_frameworks_base by crdroidandroid.

the class WallpaperCropActivity method init.

protected void init() {
    setContentView(R.layout.wallpaper_cropper);
    mCropView = (CropView) findViewById(R.id.cropView);
    Intent cropIntent = getIntent();
    final Uri imageUri = cropIntent.getData();
    if (imageUri == null) {
        Log.e(LOGTAG, "No URI passed in intent, exiting WallpaperCropActivity");
        finish();
        return;
    }
    // Action bar
    // Show the custom action bar view
    final ActionBar actionBar = getActionBar();
    actionBar.setCustomView(R.layout.actionbar_set_wallpaper);
    actionBar.getCustomView().setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            boolean finishActivityWhenDone = true;
            cropImageAndSetWallpaper(imageUri, null, finishActivityWhenDone);
        }
    });
    mSetWallpaperButton = findViewById(R.id.set_wallpaper_button);
    // Load image in background
    final BitmapRegionTileSource.UriBitmapSource bitmapSource = new BitmapRegionTileSource.UriBitmapSource(this, imageUri, 1024);
    mSetWallpaperButton.setVisibility(View.INVISIBLE);
    Runnable onLoad = new Runnable() {

        public void run() {
            if (bitmapSource.getLoadingState() != BitmapSource.State.LOADED) {
                Toast.makeText(WallpaperCropActivity.this, getString(R.string.wallpaper_load_fail), Toast.LENGTH_LONG).show();
                finish();
            } else {
                mSetWallpaperButton.setVisibility(View.VISIBLE);
            }
        }
    };
    setCropViewTileSource(bitmapSource, true, false, onLoad);
}
Also used : Intent(android.content.Intent) Uri(android.net.Uri) View(android.view.View) ActionBar(android.app.ActionBar) BitmapRegionTileSource(com.android.photos.BitmapRegionTileSource)

Example 23 with ActionBar

use of android.app.ActionBar in project android_frameworks_base by AOSPA.

the class WallpaperCropActivity method init.

protected void init() {
    setContentView(R.layout.wallpaper_cropper);
    mCropView = (CropView) findViewById(R.id.cropView);
    Intent cropIntent = getIntent();
    final Uri imageUri = cropIntent.getData();
    if (imageUri == null) {
        Log.e(LOGTAG, "No URI passed in intent, exiting WallpaperCropActivity");
        finish();
        return;
    }
    // Action bar
    // Show the custom action bar view
    final ActionBar actionBar = getActionBar();
    actionBar.setCustomView(R.layout.actionbar_set_wallpaper);
    actionBar.getCustomView().setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            boolean finishActivityWhenDone = true;
            cropImageAndSetWallpaper(imageUri, null, finishActivityWhenDone);
        }
    });
    mSetWallpaperButton = findViewById(R.id.set_wallpaper_button);
    // Load image in background
    final BitmapRegionTileSource.UriBitmapSource bitmapSource = new BitmapRegionTileSource.UriBitmapSource(this, imageUri, 1024);
    mSetWallpaperButton.setVisibility(View.INVISIBLE);
    Runnable onLoad = new Runnable() {

        public void run() {
            if (bitmapSource.getLoadingState() != BitmapSource.State.LOADED) {
                Toast.makeText(WallpaperCropActivity.this, getString(R.string.wallpaper_load_fail), Toast.LENGTH_LONG).show();
                finish();
            } else {
                mSetWallpaperButton.setVisibility(View.VISIBLE);
            }
        }
    };
    setCropViewTileSource(bitmapSource, true, false, onLoad);
}
Also used : Intent(android.content.Intent) Uri(android.net.Uri) View(android.view.View) ActionBar(android.app.ActionBar) BitmapRegionTileSource(com.android.photos.BitmapRegionTileSource)

Example 24 with ActionBar

use of android.app.ActionBar in project K6nele by Kaljurand.

the class RewritesActivity method setRewrites.

private void setRewrites(String name, String[] errors) {
    SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);
    Resources res = getResources();
    mRewrites = new Rewrites(prefs, res, name);
    int ruleCount = mRewrites.getRules().length;
    String subtitle = res.getQuantityString(R.plurals.statusLoadRewrites, ruleCount, ruleCount);
    if (errors != null) {
        int errorCount = errors.length;
        if (errorCount > 0) {
            String errorMessage = res.getQuantityString(R.plurals.statusLoadRewritesErrors, errorCount, errorCount);
            showErrors(errorMessage, errors);
            subtitle += " ยท " + errorMessage;
        }
    }
    ActionBar actionBar = getActionBar();
    if (actionBar != null) {
        actionBar.setTitle(name);
        actionBar.setSubtitle(subtitle);
    }
}
Also used : SharedPreferences(android.content.SharedPreferences) Rewrites(ee.ioc.phon.android.speak.model.Rewrites) Resources(android.content.res.Resources) ExecutableString(ee.ioc.phon.android.speak.ExecutableString) ActionBar(android.app.ActionBar)

Example 25 with ActionBar

use of android.app.ActionBar in project EhViewer by seven332.

the class SystemUiHelperImplHC method onSystemUiShown.

protected void onSystemUiShown() {
    ActionBar ab = mActivity.getActionBar();
    if (ab != null) {
        ab.show();
    }
    mActivity.getWindow().clearFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
    setIsShowing(true);
}
Also used : ActionBar(android.app.ActionBar)

Aggregations

ActionBar (android.app.ActionBar)265 View (android.view.View)58 Intent (android.content.Intent)35 TextView (android.widget.TextView)21 ColorDrawable (android.graphics.drawable.ColorDrawable)20 OnClickListener (android.view.View.OnClickListener)14 AdapterView (android.widget.AdapterView)14 ListView (android.widget.ListView)12 Bundle (android.os.Bundle)10 Test (org.junit.Test)10 SharedPreferences (android.content.SharedPreferences)9 Uri (android.net.Uri)9 Button (android.widget.Button)9 AlertDialog (android.app.AlertDialog)8 DialogInterface (android.content.DialogInterface)8 ViewPager (android.support.v4.view.ViewPager)8 SpannableString (android.text.SpannableString)8 ComponentName (android.content.ComponentName)7 ArrayAdapter (android.widget.ArrayAdapter)7 FrameLayout (android.widget.FrameLayout)7