Search in sources :

Example 96 with OnClickListener

use of android.view.View.OnClickListener in project nmid-headline by miao1007.

the class EditPage method initAtUserView.

private void initAtUserView() {
    LinearLayout atLayout = (LinearLayout) findViewByResName("atLayout");
    for (Platform platform : platforms) {
        String platformName = platform.getName();
        if (isShowAtUserLayout(platformName)) {
            View view = LayoutInflater.from(activity).inflate(getLayoutRes(activity, "skyblue_editpage_at_layout"), null);
            TextView atDescTextView = (TextView) view.findViewById(getIdRes(activity, "atDescTextView"));
            TextView atTextView = (TextView) view.findViewById(getIdRes(activity, "atTextView"));
            OnClickListener atBtnClickListener = new OnClickListener() {

                public void onClick(View v) {
                    FollowListPage subPage = new FollowListPage();
                    subPage.setPlatform((Platform) v.getTag());
                    subPage.showForResult(activity, null, EditPage.this);
                }
            };
            atTextView.setTag(platform);
            atTextView.setOnClickListener(atBtnClickListener);
            atDescTextView.setTag(platform);
            atDescTextView.setOnClickListener(atBtnClickListener);
            atTextView.setText(getAtUserButtonText(platformName));
            atDescTextView.setText(getContext().getString(getStringRes(activity, "list_friends"), getLogoName(platformName)));
            atLayout.addView(view);
        }
    }
}
Also used : Platform(cn.sharesdk.framework.Platform) OnClickListener(android.view.View.OnClickListener) TextView(android.widget.TextView) ImageView(android.widget.ImageView) HorizontalScrollView(android.widget.HorizontalScrollView) TextView(android.widget.TextView) View(android.view.View) LinearLayout(android.widget.LinearLayout)

Example 97 with OnClickListener

use of android.view.View.OnClickListener in project nmid-headline by miao1007.

the class EditPage method getAtLine.

// if platform selected form platform gridview is SinaWeibo,
// TencentWeibo, Facebook, or Twitter, there will be a button
// in the left-bottom of the page, which provides At-friends function
private LinearLayout getAtLine(String platform) {
    if (!isShowAtUserLayout(platform)) {
        return null;
    }
    LinearLayout llAt = new LinearLayout(getContext());
    LayoutParams lpAt = new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
    lpAt.rightMargin = dipToPx(getContext(), 4);
    lpAt.gravity = Gravity.LEFT | Gravity.BOTTOM;
    lpAt.weight = 1;
    llAt.setLayoutParams(lpAt);
    llAt.setOnClickListener(new OnClickListener() {

        public void onClick(View v) {
            FollowListPage subPage = new FollowListPage();
            subPage.setPlatform(platforms.get(0));
            subPage.showForResult(activity, null, EditPage.this);
        }
    });
    TextView tvAt = new TextView(getContext());
    int resId = getBitmapRes(activity, "btn_back_nor");
    if (resId > 0) {
        tvAt.setBackgroundResource(resId);
    }
    int dp_32 = dipToPx(getContext(), 32);
    tvAt.setLayoutParams(new LayoutParams(dp_32, dp_32));
    tvAt.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 18);
    tvAt.setText(getAtUserButtonText(platform));
    int dp_2 = dipToPx(getContext(), 2);
    tvAt.setPadding(0, 0, 0, dp_2);
    tvAt.setTypeface(Typeface.DEFAULT_BOLD);
    tvAt.setTextColor(0xff000000);
    tvAt.setGravity(Gravity.CENTER);
    llAt.addView(tvAt);
    TextView tvName = new TextView(getContext());
    tvName.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 18);
    tvName.setTextColor(0xff000000);
    resId = getStringRes(activity, "list_friends");
    String text = getContext().getString(resId, getName(platform));
    tvName.setText(text);
    LayoutParams lpName = new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
    lpName.gravity = Gravity.CENTER_VERTICAL;
    tvName.setLayoutParams(lpName);
    llAt.addView(tvName);
    return llAt;
}
Also used : LayoutParams(android.widget.LinearLayout.LayoutParams) OnClickListener(android.view.View.OnClickListener) TextView(android.widget.TextView) ImageView(android.widget.ImageView) HorizontalScrollView(android.widget.HorizontalScrollView) View(android.view.View) TextView(android.widget.TextView) BitmapHelper.captureView(com.mob.tools.utils.BitmapHelper.captureView) LinearLayout(android.widget.LinearLayout)

Example 98 with OnClickListener

use of android.view.View.OnClickListener in project aFileChooser by iPaulPro.

the class FileChooserExampleActivity method onCreate.

// code
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    // Create a simple button to start the file chooser process
    Button button = new Button(this);
    button.setText(R.string.choose_file);
    button.setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View v) {
            // Display the file chooser dialog
            showChooser();
        }
    });
    setContentView(button);
}
Also used : Button(android.widget.Button) OnClickListener(android.view.View.OnClickListener) View(android.view.View)

Example 99 with OnClickListener

use of android.view.View.OnClickListener in project ScrollableTabHost-for-Android by honcheng.

the class ProjectList method onCreate.

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);
    context = this;
    Button button = (Button) findViewById(R.id.getSourceButton);
    button.setOnClickListener(new OnClickListener() {

        public void onClick(View v) {
            Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("http://code.google.com/p/mobyfactory-uiwidgets-android/"));
            context.startActivity(intent);
        }
    });
    intentsArray = new ArrayList();
    // show scrollable tabhost demo
    IntentObject demoScrollabelTabHost = new IntentObject();
    demoScrollabelTabHost.title = "Scrollable TabHost";
    demoScrollabelTabHost.description = "com.mobyfactory.scrollabletabhost";
    demoScrollabelTabHost.intent = new Intent(this, DemoList_ScrollableTabHost.class);
    intentsArray.add(demoScrollabelTabHost);
    setListAdapter(new EfficientAdapter(this));
}
Also used : Button(android.widget.Button) ArrayList(java.util.ArrayList) OnClickListener(android.view.View.OnClickListener) Intent(android.content.Intent) TextView(android.widget.TextView) View(android.view.View) ListView(android.widget.ListView)

Example 100 with OnClickListener

use of android.view.View.OnClickListener in project AndroidTraining by mixi-inc.

the class MainActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    findViewById(R.id.DialogFragment).setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View v) {
            showMyDialogFragment();
        }
    });
    findViewById(R.id.AlertMyDialogFragment).setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View v) {
            showAlertMyDialogFragment();
        }
    });
    findViewById(R.id.ErrorMyAlertDialogFragment).setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View v) {
            showErrorMyAlertDialogFragment();
        }
    });
}
Also used : OnClickListener(android.view.View.OnClickListener) View(android.view.View)

Aggregations

OnClickListener (android.view.View.OnClickListener)772 View (android.view.View)770 TextView (android.widget.TextView)478 Button (android.widget.Button)262 ImageView (android.widget.ImageView)251 Intent (android.content.Intent)179 ListView (android.widget.ListView)110 AdapterView (android.widget.AdapterView)88 LinearLayout (android.widget.LinearLayout)49 ScrollView (android.widget.ScrollView)49 Bundle (android.os.Bundle)42 LayoutInflater (android.view.LayoutInflater)35 ViewGroup (android.view.ViewGroup)30 ArrayList (java.util.ArrayList)29 EditText (android.widget.EditText)27 BindView (butterknife.BindView)27 KeyEvent (android.view.KeyEvent)25 DialogInterface (android.content.DialogInterface)24 FragmentManager (android.support.v4.app.FragmentManager)23 OnItemClickListener (android.widget.AdapterView.OnItemClickListener)23