Advertisement
ajaydevgan

Untitled

Jul 30th, 2021
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 3.84 KB | None | 0 0
  1. //
  2. //
  3. //
  4.  
  5. package com.philiphacker.devilbaby;
  6.  
  7. import android.widget.Toast;
  8. import android.content.Intent;
  9. import java.util.Random;
  10. import android.util.TypedValue;
  11. import android.util.SparseBooleanArray;
  12. import java.util.ArrayList;
  13. import android.widget.ListView;
  14. import android.view.View;
  15. import android.view.View$OnClickListener;
  16. import android.os.Bundle;
  17. import android.content.SharedPreferences;
  18. import android.widget.LinearLayout;
  19. import android.widget.ImageView;
  20. import android.widget.EditText;
  21. import android.app.Activity;
  22.  
  23. public class OneActivity extends Activity
  24. {
  25.     private EditText edittext1;
  26.     private ImageView imageview1;
  27.     private LinearLayout linear1;
  28.     private LinearLayout linear2;
  29.     private SharedPreferences rook;
  30.    
  31.     private void initialize(final Bundle bundle) {
  32.         this.linear1 = (LinearLayout)this.findViewById(R.id.linear1);
  33.         this.edittext1 = (EditText)this.findViewById(R.id.edittext1);
  34.         this.linear2 = (LinearLayout)this.findViewById(R.id.linear2);
  35.         this.imageview1 = (ImageView)this.findViewById(R.id.imageview1);
  36.         this.rook = this.getSharedPreferences("rook", 0);
  37.         this.imageview1.setOnClickListener((View$OnClickListener)new View$OnClickListener() {
  38.             public void onClick(final View view) {
  39.                 OneActivity.this.imageview1.setVisibility(8);
  40.                 SketchwareUtil.showMessage(OneActivity.this.getApplicationContext(), "Rook Taken \u2713");
  41.                 OneActivity.this.rook.edit().putString("rook", "rook").commit();
  42.             }
  43.         });
  44.     }
  45.    
  46.     private void initializeLogic() {
  47.         this.imageview1.setVisibility(8);
  48.     }
  49.    
  50.     @Deprecated
  51.     public ArrayList<Double> getCheckedItemPositionsToArray(final ListView listView) {
  52.         final ArrayList<Double> list = new ArrayList<Double>();
  53.         final SparseBooleanArray checkedItemPositions = listView.getCheckedItemPositions();
  54.         for (int i = 0; i < checkedItemPositions.size(); ++i) {
  55.             if (checkedItemPositions.valueAt(i)) {
  56.                 list.add((double)checkedItemPositions.keyAt(i));
  57.             }
  58.         }
  59.         return list;
  60.     }
  61.    
  62.     @Deprecated
  63.     public float getDip(final int n) {
  64.         return TypedValue.applyDimension(1, (float)n, this.getResources().getDisplayMetrics());
  65.     }
  66.    
  67.     @Deprecated
  68.     public int getDisplayHeightPixels() {
  69.         return this.getResources().getDisplayMetrics().heightPixels;
  70.     }
  71.    
  72.     @Deprecated
  73.     public int getDisplayWidthPixels() {
  74.         return this.getResources().getDisplayMetrics().widthPixels;
  75.     }
  76.    
  77.     @Deprecated
  78.     public int getLocationX(final View view) {
  79.         final int[] array = new int[2];
  80.         view.getLocationInWindow(array);
  81.         return array[0];
  82.     }
  83.    
  84.     @Deprecated
  85.     public int getLocationY(final View view) {
  86.         final int[] array = new int[2];
  87.         view.getLocationInWindow(array);
  88.         return array[1];
  89.     }
  90.    
  91.     @Deprecated
  92.     public int getRandom(final int n, final int n2) {
  93.         return new Random().nextInt(n2 - n + 1) + n;
  94.     }
  95.    
  96.     protected void onActivityResult(final int n, final int n2, final Intent intent) {
  97.         super.onActivityResult(n, n2, intent);
  98.     }
  99.    
  100.     public void onBackPressed() {
  101.         if (this.edittext1.getText().toString().equals("KRATOS")) {
  102.             this.imageview1.setVisibility(0);
  103.         }
  104.         else {
  105.             this.finish();
  106.         }
  107.     }
  108.    
  109.     protected void onCreate(final Bundle bundle) {
  110.         super.onCreate(bundle);
  111.         this.setContentView(R.layout.one);
  112.         this.initialize(bundle);
  113.         this.initializeLogic();
  114.     }
  115.    
  116.     @Deprecated
  117.     public void showMessage(final String s) {
  118.         Toast.makeText(this.getApplicationContext(), (CharSequence)s, 0).show();
  119.     }
  120. }
  121.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement