use of android.view.View.OnClickListener in project Android-PanesLibrary by cricklet.
the class ExampleFragment method onCreateView.
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
setRetainInstance(true);
parentView = inflater.inflate(R.layout.example_fragment, container, false);
if (color != -1) {
parentView.setBackgroundColor(color);
} else {
randomizeColor();
}
parentView.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
randomizeColor();
}
});
addButton = (Button) parentView.findViewById(R.id.add);
addButton.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
addExampleFragment();
}
});
if (text1Val == -1)
text1Val = sExampleNum++;
text1 = (TextView) parentView.findViewById(R.id.text1);
text1.setText("" + text1Val);
text2 = (TextView) parentView.findViewById(R.id.text2);
text2.setText("...");
return parentView;
}
use of android.view.View.OnClickListener in project OneClickAndroid by cyngn.
the class UsbActivity method onCreate.
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
OneClickStats.sendEvent(this, OneClickStats.Categories.PAGE_SHOWN, OneClickStats.Actions.PAGE_ADB);
if (adbIsEnabled()) {
startActivity(new Intent(getBaseContext(), PtpActivity.class));
finish();
return;
}
setContentView(R.layout.usb);
ImageView instructionView = (ImageView) findViewById(R.id.usb_instructions);
DecelerateInterpolator interpolator = new DecelerateInterpolator(2.0f);
AnimationSet instructionAnimations = new AnimationSet(true);
instructionAnimations.setInterpolator(interpolator);
TranslateAnimation instructionMoveAnimation = new TranslateAnimation(0, 0, 250, 0);
instructionMoveAnimation.setDuration(1000);
instructionMoveAnimation.setStartTime(Animation.START_ON_FIRST_FRAME);
instructionAnimations.addAnimation(instructionMoveAnimation);
// we want them to read the instructions first! so we give them a few seconds
AlphaAnimation instructionFadeAnimation = new AlphaAnimation(0.0f, 1.0f);
instructionFadeAnimation.setDuration(1000);
instructionFadeAnimation.setStartOffset(500);
instructionFadeAnimation.setStartTime(Animation.START_ON_FIRST_FRAME);
instructionAnimations.addAnimation(instructionFadeAnimation);
instructionView.setAnimation(instructionAnimations);
// continue button should take even longer
AlphaAnimation buttonAnimation = new AlphaAnimation(0.0f, 1.0f);
buttonAnimation.setDuration(750);
buttonAnimation.setStartTime(Animation.START_ON_FIRST_FRAME);
buttonAnimation.setStartOffset(1000);
findViewById(R.id.next).setAnimation(buttonAnimation);
OnClickListener openUsbListener = new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent intent = new Intent();
intent.setClassName("com.android.settings", "com.android.settings.DevelopmentSettings");
try {
OneClickStats.sendEvent(view.getContext(), OneClickStats.Categories.BUTTON_CLICK, OneClickStats.Actions.BTN_ADB);
startActivity(intent);
startService(new Intent(getBaseContext(), UsbDebuggingMonitorService.class));
} catch (ActivityNotFoundException e) {
// we want to know if this happens, right?
OneClickStats.sendEvent(view.getContext(), OneClickStats.Categories.SWITCH_ERROR, OneClickStats.Actions.ERR_ADB);
}
}
};
findViewById(R.id.next).setOnClickListener(openUsbListener);
}
use of android.view.View.OnClickListener in project subsampling-scale-image-view by davemorrissey.
the class ExtensionFreehandFragment method onCreateView.
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View rootView = inflater.inflate(layout.extension_freehand_fragment, container, false);
rootView.findViewById(id.previous).setOnClickListener(new OnClickListener() {
@Override
public void onClick(View view) {
((ExtensionActivity) getActivity()).previous();
}
});
final FreehandView imageView = (FreehandView) rootView.findViewById(id.imageView);
imageView.setImage(ImageSource.asset("squirrel.jpg"));
rootView.findViewById(id.reset).setOnClickListener(new OnClickListener() {
@Override
public void onClick(View view) {
imageView.reset();
}
});
return rootView;
}
use of android.view.View.OnClickListener in project subsampling-scale-image-view by davemorrissey.
the class ImageDisplayLargeFragment method onCreateView.
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View rootView = inflater.inflate(layout.imagedisplay_large_fragment, container, false);
rootView.findViewById(id.next).setOnClickListener(new OnClickListener() {
@Override
public void onClick(View view) {
((ImageDisplayActivity) getActivity()).next();
}
});
SubsamplingScaleImageView imageView = (SubsamplingScaleImageView) rootView.findViewById(id.imageView);
imageView.setImage(ImageSource.asset("card.png"));
return rootView;
}
use of android.view.View.OnClickListener in project subsampling-scale-image-view by davemorrissey.
the class ImageDisplayRegionFragment method onCreateView.
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View rootView = inflater.inflate(layout.imagedisplay_region_fragment, container, false);
final SubsamplingScaleImageView imageView = (SubsamplingScaleImageView) rootView.findViewById(id.imageView);
imageView.setOrientation(SubsamplingScaleImageView.ORIENTATION_90);
imageView.setImage(ImageSource.asset("card.png").region(new Rect(0, 0, 3778, 2834)));
rootView.findViewById(id.previous).setOnClickListener(new OnClickListener() {
@Override
public void onClick(View view) {
((ImageDisplayActivity) getActivity()).previous();
}
});
rootView.findViewById(id.rotate).setOnClickListener(new OnClickListener() {
@Override
public void onClick(View view) {
imageView.setOrientation((imageView.getOrientation() + 90) % 360);
}
});
return rootView;
}
Aggregations