Advertisement
Guest User

MenuContents Script

a guest
Feb 25th, 2020
641
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 5.08 KB | None | 0 0
  1. private void MenuContents(){
  2.  
  3.         final RelativeLayout collapsedView = new RelativeLayout(this);
  4.         RelativeLayout.LayoutParams collapsedViewParam = new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.WRAP_CONTENT, RelativeLayout.LayoutParams.WRAP_CONTENT);
  5.         collapsedView.setLayoutParams(collapsedViewParam);
  6.         collapsedView.setVisibility(View.VISIBLE);
  7.         menuHolder.addView(collapsedView);
  8.  
  9.         final RelativeLayout expandedView = new RelativeLayout(this);
  10.         RelativeLayout.LayoutParams expandedViewParam = new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.WRAP_CONTENT, RelativeLayout.LayoutParams.WRAP_CONTENT);
  11.         expandedView.setLayoutParams(expandedViewParam);
  12.         expandedView.setVisibility(View.VISIBLE);
  13.         expandedView.setBackgroundColor(Color.parseColor("#FF0000"));
  14.         menuHolder.addView(expandedView);
  15.  
  16.         final ImageView kingIcon = new ImageView(this);
  17.         ViewGroup.LayoutParams kingIconParam = new ViewGroup.LayoutParams(175, 175);
  18.         kingIcon.setLayoutParams(kingIconParam);
  19.         collapsedView.addView(kingIcon);
  20.         File myFile = new File(Environment.getExternalStorageDirectory().getPath() + "/king/images/king_icon_round.png");
  21.         Bitmap bmp = BitmapFactory.decodeFile(myFile.getAbsolutePath());
  22.         kingIcon.setImageBitmap(bmp);
  23.  
  24.         final LinearLayout LL = new LinearLayout(this);
  25.         LinearLayout.LayoutParams LLP = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
  26.         LL.setLayoutParams(LLP);
  27.         LL.setOrientation(LinearLayout.VERTICAL);
  28.         expandedView.addView(LL);
  29.  
  30.         final TextView TV = new TextView(this);
  31.         RelativeLayout.LayoutParams TVP = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
  32.         TV.setLayoutParams(TVP);
  33.         TV.setText("Platinmods Team!");
  34.         TV.setTextColor(Color.parseColor("#A4D3EE"));
  35.         TV.setBackgroundColor(Color.parseColor("#000000"));
  36.         TV.setGravity(Gravity.CENTER_HORIZONTAL);
  37.         LL.addView(TV);
  38.  
  39.         final Switch sw = new Switch(this);
  40.         RelativeLayout.LayoutParams swP = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
  41.         sw.setLayoutParams(swP);
  42.         sw.setText("One Hit Ability Damage");
  43.         sw.setTextColor(Color.parseColor( "#adff2f"));
  44.         sw.setBackgroundColor(Color.parseColor("#000000"));
  45.         sw.setGravity(Gravity.CENTER_HORIZONTAL);
  46.         LL.addView(sw);
  47.         sw.setOnClickListener(new View.OnClickListener() {
  48.             @Override
  49.             public void onClick(View view) {
  50.                 if (sw.isChecked()) {
  51.                     Inject.write(0xC8483C, "4F 0A A0 E3 1E FF 2F E1", lib);
  52.                     sw.setTextColor(Color.parseColor("#0000FF")); //Test Purposes
  53.                 }
  54.                 else {
  55.  
  56.                     Inject.write(0xC8483C, "F0 4F 2D E9 1C B0 8D E2", lib);
  57.                     sw.setTextColor(Color.parseColor("#FF0000")); //Test Purposes
  58.                 }
  59.             }
  60.         });
  61.         final Switch sw2 = new Switch(this);
  62.         RelativeLayout.LayoutParams swP2 = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
  63.         sw2.setLayoutParams(swP2);
  64.         sw2.setText("No Ability Cost");
  65.         sw2.setTextColor(Color.parseColor( "#adff2f"));
  66.         sw2.setBackgroundColor(Color.parseColor("#000000"));
  67.         sw2.setGravity(Gravity.CENTER_HORIZONTAL);
  68.         LL.addView(sw2);
  69.         sw2.setOnClickListener(new View.OnClickListener() {
  70.             @Override
  71.             public void onClick(View view) {
  72.                 if (sw.isChecked()) {
  73.                     Inject.write(0xC643B4, "00 00 A0 E3 1E FF 2F E1", lib);
  74.                     sw.setTextColor(Color.parseColor("#0000FF")); //Test Purposes
  75.                 }
  76.                 else {
  77.  
  78.                     Inject.write(0xC643B4, "D0 02 C0 E1 1E FF 2F E1", lib);
  79.                     sw.setTextColor(Color.parseColor("#FF0000")); //Test Purposes
  80.                 }
  81.             }
  82.         });
  83.  
  84.         final ImageView iconCloseButton = new ImageView(this);
  85.         LinearLayout.LayoutParams iconCloseButtonParam = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, 75);
  86.         iconCloseButton.setLayoutParams(iconCloseButtonParam);
  87.         LL.addView(iconCloseButton);
  88.         File myFile1 = new File(Environment.getExternalStorageDirectory().getPath() + "/king/images/collapse_button1.png");
  89.         Bitmap bmp1 = BitmapFactory.decodeFile(myFile1.getAbsolutePath());
  90.         iconCloseButton.setImageBitmap(bmp1);
  91.         iconCloseButton.setOnClickListener(new View.OnClickListener() {
  92.             @Override
  93.             public void onClick(View view) {
  94.                 collapsedView.setVisibility(View.VISIBLE);
  95.                 expandedView.setVisibility(View.GONE);
  96.             }
  97.         });
  98.  
  99.         collapsedViewF = collapsedView;
  100.         expandedViewF =  expandedView;
  101.  
  102.     }
  103. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement