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;
}
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();
}
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);
}
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
}
}
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();
}
});
}
Aggregations