Created
July 9, 2014 07:33
-
-
Save rishabhmhjn/27bf6d25ae7a7878e096 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" > | |
<FrameLayout | |
android:id="@+id/content_frame" | |
android:layout_width="match_parent" | |
android:layout_height="fill_parent" /> | |
<include | |
layout="@layout/smooth_progress_bar" /> | |
</FrameLayout> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package me.unfollowers.droid.ui; | |
import me.unfollowers.droid.R; | |
import android.support.v7.app.ActionBarActivity; | |
import android.view.View; | |
import android.view.ViewGroup; | |
import android.widget.ProgressBar; | |
/** | |
* @author rishabhmhjn | |
* | |
*/ | |
public abstract class ActionBarProgressActivity extends ActionBarActivity { | |
private ProgressBar mProgressBar; | |
public static final int CONTENT_FRAME_ID = R.id.content_frame; | |
public static int getContentFrameId() { | |
return CONTENT_FRAME_ID; | |
} | |
@Override | |
public void setContentView(View view) { | |
progressBarInit().addView(view); | |
} | |
@Override | |
public void setContentView(int layoutResID) { | |
getLayoutInflater().inflate(layoutResID, progressBarInit(), true); | |
} | |
@Override | |
public void setContentView(View view, ViewGroup.LayoutParams params) { | |
progressBarInit().addView(view, params); | |
} | |
private ViewGroup progressBarInit() { | |
super.setContentView(R.layout.actionbar_progress_activity_layout); | |
mProgressBar = (ProgressBar) findViewById(R.id.activity_progress_bar); | |
return (ViewGroup) findViewById(CONTENT_FRAME_ID); | |
} | |
public ProgressBar getProgressBar() { | |
return mProgressBar; | |
} | |
@Override | |
public void setSupportProgressBarVisibility(boolean visible) { | |
getProgressBar().setVisibility(visible ? View.VISIBLE : View.GONE); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<fr.castorflex.android.smoothprogressbar.SmoothProgressBar xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:app="http://schemas.android.com/apk/res-auto" | |
android:id="@+id/activity_progress_bar" | |
android:layout_width="match_parent" | |
android:layout_height="wrap_content" | |
android:indeterminate="true" | |
android:visibility="gone" > | |
</fr.castorflex.android.smoothprogressbar.SmoothProgressBar> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment