use of android.widget.LinearLayout in project cw-omnibus by commonsguy.
the class MenuItemImpl method setActionView.
public MenuItem setActionView(int resId) {
final Context context = mMenu.getContext();
final LayoutInflater inflater = LayoutInflater.from(context);
setActionView(inflater.inflate(resId, new LinearLayout(context), false));
return this;
}
use of android.widget.LinearLayout in project SimplifyReader by chentao0707.
the class PluginSimplePlayer method goReplayPage.
// 只有重播页
private void goReplayPage() {
Logger.e(TAG, "goReplayPage");
firstLoaded = false;
isRealVideoStart = false;
if (null != mActivity)
((Activity) mActivity).runOnUiThread(new Runnable() {
@Override
public void run() {
if (null != interactFrameLayout && null != endPageView) {
interactFrameLayout.removeView(endPageView);
interactFrameLayout.addView(endPageView);
LinearLayout nextLayout = (LinearLayout) endPageView.findViewById(R.id.ll_next_play);
if (null != nextLayout)
nextLayout.setVisibility(View.GONE);
}
}
});
}
use of android.widget.LinearLayout in project SimplifyReader by chentao0707.
the class PluginSimplePlayer method hideEndPage.
private void hideEndPage() {
if (null != mActivity)
((Activity) mActivity).runOnUiThread(new Runnable() {
@Override
public void run() {
if (null != interactFrameLayout && null != endPageView) {
interactFrameLayout.removeView(endPageView);
LinearLayout nextLayout = (LinearLayout) endPageView.findViewById(R.id.ll_next_play);
if (null != nextLayout)
nextLayout.setVisibility(View.VISIBLE);
}
}
});
}
use of android.widget.LinearLayout in project TextureViewDemo by dalinaum.
the class ListActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
final Demo[] demos = { new Demo("Camera", CameraActivity.class), new Demo("GL Triangle", GLTriangleActivity.class), new Demo("Canvas", CanvasActivity.class), new Demo("Canvas2", Canvas2Activity.class), new Demo("Demo repository", null) };
super.onCreate(savedInstanceState);
final ListView listView = new ListView(this);
listView.setAdapter(new ArrayAdapter<Demo>(this, R.layout.list, R.id.activity_name, demos) {
@Override
public View getView(int position, View convertView, ViewGroup parent) {
final LinearLayout view = (LinearLayout) super.getView(position, convertView, parent);
final Demo demo = getItem(position);
final TextView activityClass = (TextView) view.findViewById(R.id.activity_class);
if (demo.classType != null) {
activityClass.setText(demo.classType.toString());
} else {
activityClass.setText("");
}
return view;
}
});
listView.setClickable(true);
listView.setOnItemClickListener(new OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
final Demo demo = (Demo) parent.getAdapter().getItem(position);
final Intent intent;
if (demo.classType != null) {
intent = new Intent(ListActivity.this, demo.classType);
} else {
final String url = "https://github.com/dalinaum/textureviewdemo";
intent = new Intent(Intent.ACTION_VIEW);
intent.setData(Uri.parse(url));
}
startActivity(intent);
}
});
setContentView(listView);
}
use of android.widget.LinearLayout in project appirater-android by drewjw81.
the class Appirater method showLoveDialog.
private static void showLoveDialog(final Context mContext, final SharedPreferences.Editor editor) {
final Dialog dialog = new Dialog(mContext);
LinearLayout layout = (LinearLayout) LayoutInflater.from(mContext).inflate(R.layout.loveapp, null);
TextView textView = (TextView) layout.findViewById(R.id.love_dialog_message);
Button yesButton = (Button) layout.findViewById(R.id.love_dialog_yes);
Button noButton = (Button) layout.findViewById(R.id.love_dialog_no);
textView.setText(String.format(mContext.getString(R.string.love_dialog_content)));
yesButton.setText(String.format(mContext.getString(R.string.love_dialog_yes)));
noButton.setText(String.format(mContext.getString(R.string.love_dialog_no)));
yesButton.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
if (editor != null) {
editor.putBoolean(PREF_APP_LOVE_CLICKED, true);
editor.commit();
}
dialog.dismiss();
showRateDialog(mContext, editor);
}
});
noButton.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
if (editor != null) {
editor.putBoolean(PREF_DONT_SHOW, true);
editor.commit();
}
dialog.dismiss();
Intent intent = new Intent();
intent.setAction("com.sbstrm.appirater.Appirater");
intent.putExtra("HATE_APP", true);
v.getContext().sendBroadcast(intent);
}
});
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
dialog.setContentView(layout, dialog.getWindow().getAttributes());
dialog.show();
}
Aggregations