Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //
- //
- //
- package com.philiphacker.devilbaby;
- import android.widget.Toast;
- import android.content.Intent;
- import java.util.Random;
- import android.util.TypedValue;
- import android.util.SparseBooleanArray;
- import java.util.ArrayList;
- import android.widget.ListView;
- import android.view.View;
- import android.view.View$OnClickListener;
- import android.os.Bundle;
- import android.content.SharedPreferences;
- import android.widget.LinearLayout;
- import android.widget.ImageView;
- import android.widget.EditText;
- import android.app.Activity;
- public class OneActivity extends Activity
- {
- private EditText edittext1;
- private ImageView imageview1;
- private LinearLayout linear1;
- private LinearLayout linear2;
- private SharedPreferences rook;
- private void initialize(final Bundle bundle) {
- this.linear1 = (LinearLayout)this.findViewById(R.id.linear1);
- this.edittext1 = (EditText)this.findViewById(R.id.edittext1);
- this.linear2 = (LinearLayout)this.findViewById(R.id.linear2);
- this.imageview1 = (ImageView)this.findViewById(R.id.imageview1);
- this.rook = this.getSharedPreferences("rook", 0);
- this.imageview1.setOnClickListener((View$OnClickListener)new View$OnClickListener() {
- public void onClick(final View view) {
- OneActivity.this.imageview1.setVisibility(8);
- SketchwareUtil.showMessage(OneActivity.this.getApplicationContext(), "Rook Taken \u2713");
- OneActivity.this.rook.edit().putString("rook", "rook").commit();
- }
- });
- }
- private void initializeLogic() {
- this.imageview1.setVisibility(8);
- }
- @Deprecated
- public ArrayList<Double> getCheckedItemPositionsToArray(final ListView listView) {
- final ArrayList<Double> list = new ArrayList<Double>();
- final SparseBooleanArray checkedItemPositions = listView.getCheckedItemPositions();
- for (int i = 0; i < checkedItemPositions.size(); ++i) {
- if (checkedItemPositions.valueAt(i)) {
- list.add((double)checkedItemPositions.keyAt(i));
- }
- }
- return list;
- }
- @Deprecated
- public float getDip(final int n) {
- return TypedValue.applyDimension(1, (float)n, this.getResources().getDisplayMetrics());
- }
- @Deprecated
- public int getDisplayHeightPixels() {
- return this.getResources().getDisplayMetrics().heightPixels;
- }
- @Deprecated
- public int getDisplayWidthPixels() {
- return this.getResources().getDisplayMetrics().widthPixels;
- }
- @Deprecated
- public int getLocationX(final View view) {
- final int[] array = new int[2];
- view.getLocationInWindow(array);
- return array[0];
- }
- @Deprecated
- public int getLocationY(final View view) {
- final int[] array = new int[2];
- view.getLocationInWindow(array);
- return array[1];
- }
- @Deprecated
- public int getRandom(final int n, final int n2) {
- return new Random().nextInt(n2 - n + 1) + n;
- }
- protected void onActivityResult(final int n, final int n2, final Intent intent) {
- super.onActivityResult(n, n2, intent);
- }
- public void onBackPressed() {
- if (this.edittext1.getText().toString().equals("KRATOS")) {
- this.imageview1.setVisibility(0);
- }
- else {
- this.finish();
- }
- }
- protected void onCreate(final Bundle bundle) {
- super.onCreate(bundle);
- this.setContentView(R.layout.one);
- this.initialize(bundle);
- this.initializeLogic();
- }
- @Deprecated
- public void showMessage(final String s) {
- Toast.makeText(this.getApplicationContext(), (CharSequence)s, 0).show();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement