use of android.widget.ProgressBar in project newsrob by marianokamp.
the class AbstractNewsRobListActivity method onPostCreate.
@Override
protected void onPostCreate(Bundle savedInstanceState) {
super.onPostCreate(savedInstanceState);
if (!shouldActionBarBeHidden()) {
findViewById(R.id.control_panel_stub).setVisibility(View.VISIBLE);
setupButtons();
}
// getLayoutInflater().inflate(R.layout.control_panel, parent);
final ViewGroup parent = (ViewGroup) findViewById(R.id.ad_parent);
final View controlPanel = findViewById(R.id.control_panel);
final View statusBar = findViewById(R.id.status_bar);
if (EntryManager.ACTION_BAR_BOTTOM.equals(getEntryManager().getActionBarLocation())) {
// put the toolbar at the bottom
parent.removeView(controlPanel);
parent.addView(controlPanel);
// show the status bar
statusBar.setVisibility(View.VISIBLE);
} else if (shouldActionBarBeHidden()) {
// show the status bar
statusBar.setVisibility(View.VISIBLE);
if (controlPanel != null)
controlPanel.setVisibility(View.GONE);
}
if (!shouldActionBarBeHidden()) {
progressIndicator = findViewById(R.id.background_progress);
progressIndicator.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
toggleProgressBarVisibility();
progressIndicator.postInvalidateDelayed(150);
}
});
progressBar = (ProgressBar) findViewById(R.id.progress_bar);
progressDescription = (TextView) findViewById(R.id.status_text);
progressContainer = (LinearLayout) findViewById(R.id.progress_container);
boolean isLightTheme = getEntryManager().isLightColorSchemeSelected();
findViewById(com.newsrob.R.id.control_panel).setBackgroundResource(isLightTheme ? R.drawable.list_header_background : R.drawable.list_header_background_dark);
findViewById(R.id.action_bar).setBackgroundResource(isLightTheme ? R.drawable.label_background : R.drawable.label_background_dark);
findViewById(R.id.status_bar).setBackgroundResource(isLightTheme ? R.drawable.label_background : R.drawable.label_background_dark);
}
getListView().setOnCreateContextMenuListener(this);
signalBackgroundDataIsTurnedOffOrInAirplaneMode();
getEntryManager().showReleaseNotes();
currentTheme = getEntryManager().getCurrentThemeResourceId();
currentActionBarLocation = getEntryManager().getActionBarLocation();
Drawable d = getResources().getDrawable(R.drawable.progress_small_white);
((ProgressBar) findViewById(R.id.progress_status_bar)).setIndeterminateDrawable(d);
TextView controlPanelText = (TextView) findViewById(R.id.control_panel_text);
if (controlPanelText != null) {
controlPanelText.setText(getDefaultControlPanelTitle());
controlPanelText.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Toast.makeText(AbstractNewsRobListActivity.this, getToastMessage(), Toast.LENGTH_LONG).show();
}
});
}
View newsRobLogo = findViewById(R.id.newsrob_logo);
if (newsRobLogo != null)
newsRobLogo.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Toast.makeText(AbstractNewsRobListActivity.this, "-> Home", Toast.LENGTH_SHORT).show();
Intent i = new Intent(AbstractNewsRobListActivity.this, DashboardListActivity.class);
i.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
i.putExtra("skip", false);
finish();
startActivity(i);
}
});
googleAdsUtil.showAds(this);
if (getIntent().hasExtra("showProgress") && getIntent().getBooleanExtra("showProgress", false))
showProgressBar();
}
use of android.widget.ProgressBar in project newsrob by marianokamp.
the class AbstractNewsRobListActivity method updateButtons.
protected void updateButtons() {
if (EntryManager.ACTION_BAR_GONE.equals(getEntryManager().getActionBarLocation())) {
ProgressBar progressStatusBar = (ProgressBar) findViewById(R.id.progress_status_bar);
progressStatusBar.setVisibility(entryManager.isModelCurrentlyUpdated() ? View.VISIBLE : View.INVISIBLE);
}
if (shouldActionBarBeHidden())
return;
if (refreshButton == null)
setupButtons();
if (refreshButton == null)
return;
View cancelButton = (View) findViewById(R.id.cancel_sync);
if (cancelButton != null)
cancelButton.setEnabled(entryManager.isModelCurrentlyUpdated() && !entryManager.isCancelRequested());
refreshButton.setTag("Refresh");
refreshButton.setImageResource(R.drawable.gen_toolbar_icon_sync);
refreshButton.setEnabled(shouldRefreshButtonBeEnabled());
refreshButton.setFocusable(refreshButton.isEnabled());
DBQuery dbq = getDbQuery();
boolean shouldHideReadItems = dbq.shouldHideReadItems();
showHideButton.setImageResource(shouldHideReadItems ? R.drawable.gen_toolbar_icon_show : R.drawable.gen_toolbar_icon_hide);
toggleOrderButton.setImageResource(getDbQuery().isSortOrderAscending() ? R.drawable.gen_toolbar_icon_sort_order_ascending : R.drawable.gen_toolbar_icon_sort_order_descending);
markAllReadButton.setEnabled(shouldMarkAllReadButtonBeEnabled());
markAllReadButton.setFocusable(markAllReadButton.isEnabled());
}
use of android.widget.ProgressBar in project baseAdapter by hongyangAndroid.
the class ViewHolder method setProgress.
public ViewHolder setProgress(int viewId, int progress) {
ProgressBar view = getView(viewId);
view.setProgress(progress);
return this;
}
use of android.widget.ProgressBar in project GSYVideoPlayer by CarGuo.
the class StandardGSYVideoPlayer method showVolumeDialog.
@Override
protected void showVolumeDialog(float deltaY, int volumePercent) {
super.showVolumeDialog(deltaY, volumePercent);
if (mVolumeDialog == null) {
View localView = LayoutInflater.from(getContext()).inflate(R.layout.video_volume_dialog, null);
mDialogVolumeProgressBar = ((ProgressBar) localView.findViewById(R.id.volume_progressbar));
if (mVolumeProgressDrawable != null) {
mDialogVolumeProgressBar.setProgressDrawable(mVolumeProgressDrawable);
}
mVolumeDialog = new Dialog(getContext(), R.style.video_style_dialog_progress);
mVolumeDialog.setContentView(localView);
mVolumeDialog.getWindow().addFlags(8);
mVolumeDialog.getWindow().addFlags(32);
mVolumeDialog.getWindow().addFlags(16);
mVolumeDialog.getWindow().setLayout(-2, -2);
WindowManager.LayoutParams localLayoutParams = mVolumeDialog.getWindow().getAttributes();
localLayoutParams.gravity = Gravity.TOP | Gravity.LEFT;
localLayoutParams.width = getWidth();
localLayoutParams.height = getHeight();
int[] location = new int[2];
getLocationOnScreen(location);
localLayoutParams.x = location[0];
localLayoutParams.y = location[1];
mVolumeDialog.getWindow().setAttributes(localLayoutParams);
}
if (!mVolumeDialog.isShowing()) {
mVolumeDialog.show();
}
mDialogVolumeProgressBar.setProgress(volumePercent);
}
use of android.widget.ProgressBar in project GSYVideoPlayer by CarGuo.
the class StandardGSYVideoPlayer method showProgressDialog.
@Override
protected void showProgressDialog(float deltaX, String seekTime, int seekTimePosition, String totalTime, int totalTimeDuration) {
super.showProgressDialog(deltaX, seekTime, seekTimePosition, totalTime, totalTimeDuration);
if (mProgressDialog == null) {
View localView = LayoutInflater.from(getContext()).inflate(R.layout.video_progress_dialog, null);
mDialogProgressBar = ((ProgressBar) localView.findViewById(R.id.duration_progressbar));
if (mDialogProgressBarDrawable != null) {
mDialogProgressBar.setProgressDrawable(mDialogProgressBarDrawable);
}
mDialogSeekTime = ((TextView) localView.findViewById(R.id.tv_current));
mDialogTotalTime = ((TextView) localView.findViewById(R.id.tv_duration));
mDialogIcon = ((ImageView) localView.findViewById(R.id.duration_image_tip));
mProgressDialog = new Dialog(getContext(), R.style.video_style_dialog_progress);
mProgressDialog.setContentView(localView);
mProgressDialog.getWindow().addFlags(Window.FEATURE_ACTION_BAR);
mProgressDialog.getWindow().addFlags(32);
mProgressDialog.getWindow().addFlags(16);
mProgressDialog.getWindow().setLayout(getWidth(), getHeight());
if (mDialogProgressNormalColor != -11) {
mDialogTotalTime.setTextColor(mDialogProgressNormalColor);
}
if (mDialogProgressHighLightColor != -11) {
mDialogSeekTime.setTextColor(mDialogProgressHighLightColor);
}
WindowManager.LayoutParams localLayoutParams = mProgressDialog.getWindow().getAttributes();
localLayoutParams.gravity = Gravity.TOP;
localLayoutParams.width = getWidth();
localLayoutParams.height = getHeight();
int[] location = new int[2];
getLocationOnScreen(location);
localLayoutParams.x = location[0];
localLayoutParams.y = location[1];
mProgressDialog.getWindow().setAttributes(localLayoutParams);
}
if (!mProgressDialog.isShowing()) {
mProgressDialog.show();
}
mDialogSeekTime.setText(seekTime);
mDialogTotalTime.setText(" / " + totalTime);
if (totalTimeDuration > 0)
mDialogProgressBar.setProgress(seekTimePosition * 100 / totalTimeDuration);
if (deltaX > 0) {
mDialogIcon.setBackgroundResource(R.drawable.video_forward_icon);
} else {
mDialogIcon.setBackgroundResource(R.drawable.video_backward_icon);
}
}
Aggregations