Search in sources :

Example 6 with LinearLayout

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;
}
Also used : Context(android.content.Context) LayoutInflater(android.view.LayoutInflater) LinearLayout(android.widget.LinearLayout)

Example 7 with LinearLayout

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);
                }
            }
        });
}
Also used : LinearLayout(android.widget.LinearLayout)

Example 8 with LinearLayout

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);
                }
            }
        });
}
Also used : LinearLayout(android.widget.LinearLayout)

Example 9 with LinearLayout

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);
}
Also used : OnItemClickListener(android.widget.AdapterView.OnItemClickListener) ViewGroup(android.view.ViewGroup) Intent(android.content.Intent) TextView(android.widget.TextView) View(android.view.View) AdapterView(android.widget.AdapterView) ListView(android.widget.ListView) ListView(android.widget.ListView) TextView(android.widget.TextView) LinearLayout(android.widget.LinearLayout)

Example 10 with LinearLayout

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();
}
Also used : Button(android.widget.Button) Dialog(android.app.Dialog) AlertDialog(android.app.AlertDialog) OnClickListener(android.view.View.OnClickListener) TextView(android.widget.TextView) Intent(android.content.Intent) TextView(android.widget.TextView) View(android.view.View) LinearLayout(android.widget.LinearLayout)

Aggregations

LinearLayout (android.widget.LinearLayout)1171 View (android.view.View)457 TextView (android.widget.TextView)435 ViewGroup (android.view.ViewGroup)200 ImageView (android.widget.ImageView)189 Button (android.widget.Button)164 ScrollView (android.widget.ScrollView)123 ListView (android.widget.ListView)97 LayoutInflater (android.view.LayoutInflater)86 FrameLayout (android.widget.FrameLayout)85 Context (android.content.Context)74 AdapterView (android.widget.AdapterView)71 EditText (android.widget.EditText)69 Intent (android.content.Intent)58 AbsListView (android.widget.AbsListView)58 LayoutParams (android.widget.LinearLayout.LayoutParams)48 RelativeLayout (android.widget.RelativeLayout)48 Bitmap (android.graphics.Bitmap)45 OnClickListener (android.view.View.OnClickListener)44 Drawable (android.graphics.drawable.Drawable)42