Search in sources :

Example 16 with OnClickListener

use of android.view.View.OnClickListener in project subsampling-scale-image-view by davemorrissey.

the class ImageDisplayRotateFragment method onCreateView.

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View rootView = inflater.inflate(layout.imagedisplay_rotate_fragment, container, false);
    final SubsamplingScaleImageView imageView = (SubsamplingScaleImageView) rootView.findViewById(id.imageView);
    imageView.setImage(ImageSource.asset("squirrel.jpg"));
    imageView.setOrientation(90);
    rootView.findViewById(id.previous).setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View view) {
            ((ImageDisplayActivity) getActivity()).previous();
        }
    });
    rootView.findViewById(id.next).setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View view) {
            ((ImageDisplayActivity) getActivity()).next();
        }
    });
    rootView.findViewById(id.rotate).setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View view) {
            imageView.setOrientation((imageView.getOrientation() + 90) % 360);
        }
    });
    return rootView;
}
Also used : OnClickListener(android.view.View.OnClickListener) SubsamplingScaleImageView(com.davemorrissey.labs.subscaleview.SubsamplingScaleImageView) SubsamplingScaleImageView(com.davemorrissey.labs.subscaleview.SubsamplingScaleImageView) View(android.view.View)

Example 17 with OnClickListener

use of android.view.View.OnClickListener 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)

Example 18 with OnClickListener

use of android.view.View.OnClickListener in project android by cSploit.

the class Traceroute method onCreate.

@Override
public void onCreate(Bundle savedInstanceState) {
    SharedPreferences themePrefs = getSharedPreferences("THEME", 0);
    Boolean isDark = themePrefs.getBoolean("isDark", false);
    if (isDark)
        setTheme(R.style.DarkTheme);
    else
        setTheme(R.style.AppTheme);
    super.onCreate(savedInstanceState);
    mTraceFloatingActionButton = (FloatingActionButton) findViewById(R.id.traceToggleButton);
    mTraceProgress = (ProgressBar) findViewById(R.id.traceActivity);
    mTraceFloatingActionButton.setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View v) {
            if (mRunning) {
                setStoppedState();
            } else {
                setStartedState();
            }
        }
    });
    ListView mTraceList = (ListView) findViewById(R.id.traceListView);
    mListAdapter = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1);
    mTraceList.setAdapter(mListAdapter);
}
Also used : ListView(android.widget.ListView) SharedPreferences(android.content.SharedPreferences) OnClickListener(android.view.View.OnClickListener) View(android.view.View) ListView(android.widget.ListView)

Example 19 with OnClickListener

use of android.view.View.OnClickListener in project ArcMenu by daCapricorn.

the class MainActivity method onCreate.

/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);
    ArcMenu arcMenu = (ArcMenu) findViewById(R.id.arc_menu);
    ArcMenu arcMenu2 = (ArcMenu) findViewById(R.id.arc_menu_2);
    initArcMenu(arcMenu, ITEM_DRAWABLES);
    initArcMenu(arcMenu2, ITEM_DRAWABLES);
    RayMenu rayMenu = (RayMenu) findViewById(R.id.ray_menu);
    final int itemCount = ITEM_DRAWABLES.length;
    for (int i = 0; i < itemCount; i++) {
        ImageView item = new ImageView(this);
        item.setImageResource(ITEM_DRAWABLES[i]);
        final int position = i;
        rayMenu.addItem(item, new OnClickListener() {

            @Override
            public void onClick(View v) {
                Toast.makeText(MainActivity.this, "position:" + position, Toast.LENGTH_SHORT).show();
            }
        });
    // Add a menu item
    }
}
Also used : ArcMenu(com.capricorn.ArcMenu) OnClickListener(android.view.View.OnClickListener) RayMenu(com.capricorn.RayMenu) ImageView(android.widget.ImageView) ImageView(android.widget.ImageView) View(android.view.View)

Example 20 with OnClickListener

use of android.view.View.OnClickListener in project UltimateAndroid by cymcsg.

the class ImageGridActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.group_activity_image_grid);
    helper = AlbumHelper.getHelper();
    helper.init(getApplicationContext());
    dataList = (List<ImageItem>) getIntent().getSerializableExtra(EXTRA_IMAGE_LIST);
    initView();
    bt = (Button) findViewById(R.id.bt);
    bt.setOnClickListener(new OnClickListener() {

        public void onClick(View v) {
            ArrayList<String> list = new ArrayList<String>();
            Collection<String> c = adapter.map.values();
            Iterator<String> it = c.iterator();
            for (; it.hasNext(); ) {
                list.add(it.next());
            }
            //				}
            for (int i = 0; i < list.size(); i++) {
                if (Bimp.drr.size() < 9) {
                    Bimp.drr.add(list.get(i));
                }
            }
            finish();
        }
    });
}
Also used : ArrayList(java.util.ArrayList) Iterator(java.util.Iterator) OnClickListener(android.view.View.OnClickListener) Collection(java.util.Collection) GridView(android.widget.GridView) View(android.view.View) AdapterView(android.widget.AdapterView)

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