Search in sources :

Example 66 with ActionBar

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

the class MyActivity method test1.

@Override
public void test1() {
    ActionBar actionBar = getActionBar();
    GridLayout gridLayout = new GridLayout(null);
    int x = View.DRAWING_CACHE_QUALITY_AUTO;
    int y = View.MEASURED_HEIGHT_STATE_SHIFT;
    int alignmentMode = gridLayout.getAlignmentMode();
    gridLayout.setRowOrderPreserved(true);
    setContentView(R.layout.main);
}
Also used : GridLayout(android.widget.GridLayout) ActionBar(android.app.ActionBar) SuppressLint(android.annotation.SuppressLint)

Example 67 with ActionBar

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

the class MyActivity method testSuppressed.

@SuppressLint("NewApi")
public void testSuppressed() {
    ActionBar actionBar = getActionBar();
    GridLayout gridLayout = new GridLayout(null);
    int x = View.DRAWING_CACHE_QUALITY_AUTO;
    int y = View.MEASURED_HEIGHT_STATE_SHIFT;
    int alignmentMode = gridLayout.getAlignmentMode();
    gridLayout.setRowOrderPreserved(true);
}
Also used : GridLayout(android.widget.GridLayout) ActionBar(android.app.ActionBar) SuppressLint(android.annotation.SuppressLint) SuppressLint(android.annotation.SuppressLint)

Example 68 with ActionBar

use of android.app.ActionBar in project android-app by spark.

the class BaseActivity method onDevicesUpdated.

private void onDevicesUpdated() {
    ActionBar actionBar = getActionBar();
    if (actionBar != null && shouldShowUpButtonWhenDevicesListNotEmpty()) {
        boolean noDevices = DeviceState.getKnownDevices().isEmpty();
        getActionBar().setDisplayHomeAsUpEnabled(!noDevices);
        getActionBar().setHomeButtonEnabled(!noDevices);
    }
}
Also used : ActionBar(android.app.ActionBar)

Example 69 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 70 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)

Aggregations

ActionBar (android.app.ActionBar)158 View (android.view.View)37 Intent (android.content.Intent)19 AdapterView (android.widget.AdapterView)11 TextView (android.widget.TextView)11 ListView (android.widget.ListView)9 SharedPreferences (android.content.SharedPreferences)8 Uri (android.net.Uri)7 ArrayAdapter (android.widget.ArrayAdapter)7 FrameLayout (android.widget.FrameLayout)7 SpannableString (android.text.SpannableString)6 BitmapRegionTileSource (com.android.photos.BitmapRegionTileSource)6 GridLayoutManager (android.support.v7.widget.GridLayoutManager)5 RecyclerView (android.support.v7.widget.RecyclerView)5 CircularProgressButton (com.dd.CircularProgressButton)5 CircularProgressButton (com.marshalchen.common.uimodule.circularProgressButton.CircularProgressButton)5 SuppressLint (android.annotation.SuppressLint)4 Bundle (android.os.Bundle)4 ViewPager (android.support.v4.view.ViewPager)4 MenuInflater (android.view.MenuInflater)4