Example usage for android.view Window FEATURE_INDETERMINATE_PROGRESS

List of usage examples for android.view Window FEATURE_INDETERMINATE_PROGRESS

Introduction

In this page you can find the example usage for android.view Window FEATURE_INDETERMINATE_PROGRESS.

Prototype

int FEATURE_INDETERMINATE_PROGRESS

To view the source code for android.view Window FEATURE_INDETERMINATE_PROGRESS.

Click Source Link

Document

Flag for indeterminate progress.

Usage

From source file:joshuatee.wx.WX.java

@Override
protected void onCreate(Bundle savedInstanceState) {

    if (savedInstanceState != null) {
        savedInstanceState.remove("android:support:fragments");
    }//from  w  w  w .  ja  va  2s  . c om

    super.onCreate(savedInstanceState);

    requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
    preferences = PreferenceManager.getDefaultSharedPreferences(this);
    theme_blue_current = preferences.getString("THEME_BLUE", "");
    setTheme(Utility.Theme(theme_blue_current));
    setContentView(R.layout.main);

    simple_mode_current = preferences.getString("SIMPLE_MODE", "");

    if (!DataStore.loaded)
        DataStore.Init(this);

    viewPager = (ViewPager) findViewById(R.id.pager);
    actionBar = getActionBar();
    mAdapter = new TabsPagerAdapter(getSupportFragmentManager());
    viewPager.setAdapter(mAdapter);
    viewPager.setOffscreenPageLimit(4);
    actionBar.setHomeButtonEnabled(false);
    actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);

    if (simple_mode_current.startsWith("f")) {
        for (String tab_name : tabs) {
            actionBar.addTab(actionBar.newTab().setText(tab_name).setTabListener(this));
        }
    } else {
        for (String tab_name : tabs_simple) {
            actionBar.addTab(actionBar.newTab().setText(tab_name).setTabListener(this));
        }
    }

    viewPager.setOnPageChangeListener(new ViewPager.OnPageChangeListener() {

        @Override
        public void onPageSelected(int position) {
            actionBar.setSelectedNavigationItem(position);
        }

        @Override
        public void onPageScrolled(int arg0, float arg1, int arg2) {
        }

        @Override
        public void onPageScrollStateChanged(int arg0) {
        }
    });

    refresh_dynamic_content();

}

From source file:com.andrewshu.android.reddit.mail.InboxActivity.java

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    mSettings.loadRedditPreferences(this, mClient);
    setRequestedOrientation(mSettings.getRotation());
    setTheme(mSettings.getTheme());/*from   w w  w  . j a va2  s.co m*/

    requestWindowFeature(Window.FEATURE_PROGRESS);
    requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);

    for (String whichInbox : whichInboxes)
        addInboxTab(whichInbox);

    getTabHost().setCurrentTab(0);
}

From source file:com.google.devrel.samples.memedroid.app.CreateActivity.java

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    overridePendingTransition(R.anim.translate_in_top, R.anim.translate_out_top);
    requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
    setContentView(R.layout.activity_create);
    if (getActionBar() != null) {
        getActionBar().setDisplayHomeAsUpEnabled(true);
    }/*w ww  .j  ava 2  s. c o  m*/
    mHandler = new Handler();

    ViewPager viewPager = (ViewPager) findViewById(R.id.view_pager);
    GridView gridView = (GridView) findViewById(R.id.template_grid);
    if (viewPager != null) {
        PagerAdapter adapter = new MemeTemplatePagerAdapter(getSupportFragmentManager());
        viewPager.setAdapter(adapter);
        mAdapter = (TemplateAdapter) adapter;
        viewPager.setOffscreenPageLimit(3);
        viewPager.setPageMargin(-54);
        viewPager.setOnPageChangeListener(this);
        mCurrentView = viewPager;
        findViewById(R.id.meme_template_number).setVisibility(View.VISIBLE);
    } else if (gridView != null) {
        ListAdapter adapter = new MemeTemplateAdapter(this, R.layout.fragment_meme);
        gridView.setAdapter(adapter);
        mAdapter = (TemplateAdapter) adapter;
        mCurrentView = gridView;
        gridView.setChoiceMode(AbsListView.CHOICE_MODE_SINGLE);
        gridView.setOnItemClickListener(this);
    } else {
        throw new IllegalStateException("No valid layout found.");
    }
    getSupportLoaderManager().initLoader(MEME_TEMPLATE_LIST, null, this);
    if (savedInstanceState != null) {
        mHasText = savedInstanceState.getBoolean(STATE_TEXT, false);
        getSupportLoaderManager().restartLoader(MEME_TEMPLATE_LIST, null, CreateActivity.this);
    }
    EditText et = (EditText) findViewById(R.id.top_text);
    et.addTextChangedListener(this);
    setProgressBarIndeterminateVisibility(true);
}

From source file:org.wingy.jp8chan.ui.activity.ImageViewActivity.java

@Override
protected void onCreate(Bundle savedInstanceState) {
    requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
    ActionBar actionBar = getActionBar();
    actionBar.setDisplayOptions(ActionBar.DISPLAY_SHOW_TITLE | ActionBar.DISPLAY_HOME_AS_UP);

    super.onCreate(savedInstanceState);

    if (postAdapter == null) {
        Logger.e(TAG, "Posts in ImageViewActivity was null");
        finish();// w  w w  .j ava 2  s  .  com
        return;
    }

    threadManager = threadManagerStatic;

    ThemeHelper.setTheme(this);

    progressBar = new ProgressBar(this, null, android.R.attr.progressBarStyleHorizontal);
    progressBar.setLayoutParams(new FrameLayout.LayoutParams(FrameLayout.LayoutParams.MATCH_PARENT,
            FrameLayout.LayoutParams.WRAP_CONTENT));
    progressBar.setProgressDrawable(getResources().getDrawable(R.drawable.progressbar_no_bg));
    progressBar.setIndeterminate(false);
    progressBar.setMax(1000000);

    final FrameLayout decorView = (FrameLayout) getWindow().getDecorView();
    decorView.addView(progressBar);

    progressBar.post(new Runnable() {
        @Override
        public void run() {
            View contentView = decorView.findViewById(android.R.id.content);
            progressBar.setY(contentView.getY() - progressBar.getHeight() / 2);
        }
    });

    // Get the posts with images
    ArrayList<Post> imagePosts = new ArrayList<>();
    for (Post post : postAdapter.getList()) {
        if (post.hasImage) {
            imagePosts.add(post);
        }
    }

    // Setup our pages and adapter
    setContentView(R.layout.image_pager);
    viewPager = (ViewPager) findViewById(R.id.image_pager);
    adapter = new ImageViewAdapter(getFragmentManager(), this);
    adapter.setList(imagePosts);
    viewPager.setAdapter(adapter);
    viewPager.setOnPageChangeListener(this);

    // Select the right image
    for (int i = 0; i < imagePosts.size(); i++) {
        if (imagePosts.get(i).no == selectedId) {
            viewPager.setCurrentItem(i);
            onPageSelected(i);
            break;
        }
    }
}

From source file:com.lithidsw.wallbox.MainActivity.java

@Override
protected void onCreate(Bundle savedInstanceState) {
    prefs = getSharedPreferences(C.PREF, MODE_PRIVATE);
    String themeSty = prefs.getString(C.PREF_THEME, null);
    if (themeSty != null) {
        setTheme(getResources().getIdentifier(themeSty, "style", C.THIS));
    } else {/*from   ww  w .  jav a2s.  co  m*/
        setTheme(C.DEFAULT_THEME);
    }
    super.onCreate(savedInstanceState);
    requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
    setContentView(R.layout.activity_main);
    mTitle = getTitle();
    menuHelper = new MenuHelper(this);
    mMainTitles = getResources().getStringArray(R.array.main_titles);

    mDrawerList = (ListView) findViewById(R.id.left_drawer);
    mDrawerList.setAdapter(new ArrayAdapter<String>(this, R.layout.drawer_list_item, mMainTitles));
    mDrawerList.setOnItemClickListener(new DrawerItemClickListener());

    mDrawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout);
    if (mDrawerLayout != null) {
        setupActionBar();
        mDrawerLayout.setDrawerShadow(R.drawable.drawer_shadow, GravityCompat.START);
        mDrawerToggle = new ActionBarDrawerToggle(this, mDrawerLayout, R.drawable.ic_drawer,
                R.string.drawer_open, R.string.drawer_close) {
            public void onDrawerClosed(View view) {
                setTitle(mMainTitles[mDrawerList.getCheckedItemPosition()]);
                invalidateOptionsMenu();
            }

            public void onDrawerOpened(View drawerView) {
                setTitle(mTitle);
                setProgressBarIndeterminateVisibility(false);
                invalidateOptionsMenu();
            }
        };
        mDrawerLayout.setDrawerListener(mDrawerToggle);
    }

    if (savedInstanceState == null) {
        if (getIntent().getBooleanExtra("open_themes_drawer", false)) {
            selectItem(5);
        } else {
            selectItem(0);
        }
    }
}

From source file:com.scigames.registration.Registration4PhotoActivity.java

/** Called with the activity is first created. */
@Override/* w  w w .  j  a  va2  s. com*/
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    Log.d(TAG, "super.OnCreate");
    requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
    getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LOW_PROFILE);
    Intent i = getIntent();
    Log.d(TAG, "getIntent");
    firstNameIn = i.getStringExtra("fName");
    lastNameIn = i.getStringExtra("lName");
    studentIdIn = i.getStringExtra("studentId");
    visitIdIn = i.getStringExtra("visitId");
    Log.d(TAG, "...getStringExtra");

    // Inflate our UI from its XML layout description.
    setContentView(R.layout.registration4_photo);
    Log.d(TAG, "...setContentView");

    avatarPhoto = (ImageView) this.findViewById(R.id.avatar_photo);
    Log.d(TAG, "...findViewById. avatar_photo");

    or = (TextView) findViewById(R.id.or);
    or.setVisibility(View.INVISIBLE);
    retakeButton = (Button) findViewById(R.id.retake_pic);
    retakeButton.setVisibility(View.INVISIBLE);
    retakeButton.setOnClickListener(mTakePhotoListener);

    saveButton = (Button) findViewById(R.id.save_button);
    saveButton.setOnClickListener(mContinueButtonListener);
    saveButton.setVisibility(View.INVISIBLE);

    takePhotoButton = (Button) findViewById(R.id.take_pic);
    takePhotoButton.setOnClickListener(mTakePhotoListener);
    takePhotoButton.setVisibility(View.VISIBLE);
    //((Button) findViewById(R.id.take_pic)).setOnClickListener(mTakePhotoListener);
    Log.d(TAG, "...instantiateButtons");

    //set listener
    task.setOnResultsListener(this);

    Typeface ExistenceLightOtf = Typeface.createFromAsset(getAssets(), "fonts/Existence-Light.ttf");
    Typeface Museo300Regular = Typeface.createFromAsset(getAssets(), "fonts/Museo300-Regular.otf");
    Typeface Museo500Regular = Typeface.createFromAsset(getAssets(), "fonts/Museo500-Regular.otf");
    Typeface Museo700Regular = Typeface.createFromAsset(getAssets(), "fonts/Museo700-Regular.otf");

    //       TextView welcome = (TextView)findViewById(R.id.welcome);
    //instruction = (TextView)findViewById(R.id.instructions);
    //       setTextViewFont(ExistenceLightOtf, welcome);
    setButtonFont(Museo500Regular, retakeButton);
    setTextViewFont(Museo300Regular, or);
}

From source file:com.twolinessoftware.smarterlist.activity.BaseActivity.java

@TargetApi(Build.VERSION_CODES.LOLLIPOP)
@Override/*from ww  w  .  j  a v a 2 s  .c om*/
protected void onCreate(final Bundle savedInstanceState) {

    getWindow().requestFeature(Window.FEATURE_ACTION_BAR_OVERLAY);
    getWindow().requestFeature(Window.FEATURE_CONTENT_TRANSITIONS);

    supportRequestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);

    super.onCreate(savedInstanceState);

    setContentView(getContentView());

    if (getSupportActionBar() != null) {
        getSupportActionBar().setElevation(getResources().getDimensionPixelSize(R.dimen.toolbar_elevation));
        getSupportActionBar().setHomeButtonEnabled(true);
    }
    Injector.inject(this);
}

From source file:com.tvserial.plot.amazon.trailer.MainActivity.java

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
    setContentView(R.layout.activity_main);
    getActionBar().setLogo(getResources().getDrawable(R.drawable.app_icon));
    context = this;
    tabs = (PagerSlidingTabStrip) findViewById(R.id.tabs);
    pager = (ViewPager) findViewById(R.id.pager);
    adapter = new MyPagerAdapter(getSupportFragmentManager());

    pager.setAdapter(adapter);//from ww w. j a v  a  2 s  .  c  om

    final int pageMargin = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 4,
            getResources().getDisplayMetrics());
    pager.setPageMargin(pageMargin);

    tabs.setViewPager(pager);

    tabs.setViewPager(pager);
    tabs.setOnTouchListener(new OnTouchListener() {

        @Override
        public boolean onTouch(View v, MotionEvent event) {
            // TODO Auto-generated method stub
            return false;
        }
    });

    Fileread();
    AllFragment = new AllListFragment();
    Action_adventure = new ActionListFragment();
    Animation = new AnimationlistFragment();
    Classic = new ClassicListFragment();
    Comedy = new ComedyListFragment();
    Drama = new DramaListFragment();
    Kids = new KidsListFragment();
    LAtino = new LatinolListFragment();
    Nonfiction = new NonfictionlListFragment();
    Reality_URL = new RealityListFragment();
    Scifi = new ScifilListFragment();
    Sports = new SportsListFragment();
    Teen_URL = new TeenListFragment();
    //changeColor(currentColor);

    AdView adView = new AdView(this);
    adView.setAdSize(AdSize.BANNER);
    adView.setAdUnitId("ca-app-pub-2884314377778347/8122550310");

    // Add the AdView to the view hierarchy. The view will have no size
    // until the ad is loaded.
    LinearLayout layout = (LinearLayout) findViewById(R.id.a);
    layout.addView(adView);

    // Create an ad request. Check logcat output for the hashed device ID to
    // get test ads on a physical device.
    AdRequest adRequest = new AdRequest.Builder().build();

    // Start loading the ad in the background.
    adView.loadAd(adRequest);
}

From source file:org.openhab.habdroid.ui.OpenHABStartupActivity.java

@Override
public void onCreate(Bundle savedInstanceState) {
    requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
    requestWindowFeature(Window.FEATURE_PROGRESS);
    super.onCreate(savedInstanceState);
    setContentView(R.layout.openhabstartup);

    //      initPage();

}

From source file:com.google.android.demos.atom.app.FeedActivity.java

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
    setContentView(R.layout.list_activity);
    ListView listView = (ListView) findViewById(android.R.id.list);
    mEmpty = findViewById(R.id.empty);//from ww w .  j a  v a  2 s. co m
    mLoading = findViewById(R.id.loading);
    mError = findViewById(R.id.error);
    mError.findViewById(R.id.retry).setOnClickListener(this);

    // Loader from last Activity instance may still be loading
    mLoading.setVisibility(View.VISIBLE);
    mEmpty.setVisibility(View.GONE);
    mError.setVisibility(View.GONE);

    mPreferences = PreferenceManager.getDefaultSharedPreferences(this);

    mAdapter = new FeedAdapter(this);
    mAdapter.registerDataSetObserver(new TitleObserver());
    listView.setAdapter(mAdapter);
    listView.setOnItemClickListener(this);
    getSupportLoaderManager().initLoader(LOADER_ENTRIES, Bundle.EMPTY, this);
}