Search in sources :

Example 61 with ActionBar

use of android.app.ActionBar in project UltimateAndroid by cymcsg.

the class Sample1Activity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.circular_progress_ac_sample_1);
    ActionBar actionBar = getActionBar();
    if (actionBar != null) {
        actionBar.setTitle("IndeterminateProgressSample");
    }
    final CircularProgressButton circularButton1 = (CircularProgressButton) findViewById(R.id.circularButton1);
    circularButton1.setIndeterminateProgressMode(true);
    circularButton1.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            if (circularButton1.getProgress() == 0) {
                circularButton1.setProgress(50);
            } else if (circularButton1.getProgress() == 100) {
                circularButton1.setProgress(0);
            } else {
                circularButton1.setProgress(100);
            }
        }
    });
    final CircularProgressButton circularButton2 = (CircularProgressButton) findViewById(R.id.circularButton2);
    circularButton2.setIndeterminateProgressMode(true);
    circularButton2.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            if (circularButton2.getProgress() == 0) {
                circularButton2.setProgress(50);
            } else if (circularButton2.getProgress() == -1) {
                circularButton2.setProgress(0);
            } else {
                circularButton2.setProgress(-1);
            }
        }
    });
}
Also used : CircularProgressButton(com.marshalchen.common.uimodule.circularProgressButton.CircularProgressButton) View(android.view.View) ActionBar(android.app.ActionBar)

Example 62 with ActionBar

use of android.app.ActionBar in project UltimateAndroid by cymcsg.

the class Sample5Activity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.circular_progress_ac_sample_5);
    ActionBar actionBar = getActionBar();
    if (actionBar != null) {
        actionBar.setTitle("CustomSelectorSample");
    }
    final CircularProgressButton circularButton1 = (CircularProgressButton) findViewById(R.id.circularButton1);
    circularButton1.setIndeterminateProgressMode(true);
    circularButton1.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            if (circularButton1.getProgress() == 0) {
                circularButton1.setProgress(50);
            } else if (circularButton1.getProgress() == 100) {
                circularButton1.setProgress(0);
            } else {
                circularButton1.setProgress(100);
            }
        }
    });
    final CircularProgressButton circularButton2 = (CircularProgressButton) findViewById(R.id.circularButton2);
    circularButton2.setIndeterminateProgressMode(true);
    circularButton2.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            if (circularButton2.getProgress() == 0) {
                circularButton2.setProgress(50);
            } else if (circularButton2.getProgress() == -1) {
                circularButton2.setProgress(0);
            } else {
                circularButton2.setProgress(-1);
            }
        }
    });
}
Also used : CircularProgressButton(com.marshalchen.common.uimodule.circularProgressButton.CircularProgressButton) View(android.view.View) ActionBar(android.app.ActionBar)

Example 63 with ActionBar

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

the class NekoLand method onCreate.

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.neko_activity);
    final ActionBar actionBar = getActionBar();
    if (actionBar != null) {
        actionBar.setLogo(Cat.create(this));
        actionBar.setDisplayUseLogoEnabled(false);
        actionBar.setDisplayShowHomeEnabled(true);
    }
    mPrefs = new PrefState(this);
    mPrefs.setListener(this);
    final RecyclerView recyclerView = (RecyclerView) findViewById(R.id.holder);
    mAdapter = new CatAdapter();
    recyclerView.setAdapter(mAdapter);
    recyclerView.setLayoutManager(new GridLayoutManager(this, 3));
    int numCats = updateCats();
    MetricsLogger.histogram(this, "egg_neko_visit_gallery", numCats);
}
Also used : GridLayoutManager(android.support.v7.widget.GridLayoutManager) RecyclerView(android.support.v7.widget.RecyclerView) ActionBar(android.app.ActionBar)

Example 64 with ActionBar

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

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 65 with ActionBar

use of android.app.ActionBar in project ActionBar-PullToRefresh by chrisbanes.

the class FragmentTabsActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_fragment_tabs);
    // Add 3 tabs which will switch fragments
    ActionBar ab = getActionBar();
    ab.addTab(ab.newTab().setText("Tab 1").setTabListener(this));
    ab.addTab(ab.newTab().setText("Tab 2").setTabListener(this));
    ab.addTab(ab.newTab().setText("Tab 3").setTabListener(this));
    ab.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
}
Also used : ActionBar(android.app.ActionBar)

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