mirror of
https://github.com/xoureldeen/Vectras-VM-Android.git
synced 2026-05-02 00:00:25 +00:00
13H18D11M12Y2024
This commit is contained in:
parent
f481aa2d68
commit
64b5bf2185
9 changed files with 167 additions and 123 deletions
|
|
@ -508,6 +508,22 @@ public class CustomRomActivity extends AppCompatActivity {
|
|||
drive.setText(AppConfig.vmFolder + vmID + "/" + getIntent().getStringExtra("romfilename"));
|
||||
}
|
||||
}
|
||||
|
||||
} else if (getIntent().hasExtra("importcvbinow")) {
|
||||
title.setText("New VM");
|
||||
setDefault();
|
||||
|
||||
Intent intent = new Intent(ACTION_OPEN_DOCUMENT);
|
||||
intent.addCategory(Intent.CATEGORY_OPENABLE);
|
||||
intent.setType("*/*");
|
||||
|
||||
// Optionally, specify a URI for the file that should appear in the
|
||||
// system file picker when it loads.
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||
intent.putExtra(DocumentsContract.EXTRA_INITIAL_URI, Environment.DIRECTORY_DOWNLOADS);
|
||||
}
|
||||
|
||||
startActivityForResult(intent, 0);
|
||||
} else {
|
||||
title.setText("New VM");
|
||||
setDefault();
|
||||
|
|
@ -908,6 +924,7 @@ public class CustomRomActivity extends AppCompatActivity {
|
|||
|
||||
if (getIntent().hasExtra("addromnow")) {
|
||||
RomsManagerActivity.isFinishNow = true;
|
||||
RomInfo.isFinishNow = true;
|
||||
}
|
||||
|
||||
modify = false;
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@ import android.widget.TextView;
|
|||
import androidx.activity.EdgeToEdge;
|
||||
import androidx.annotation.RequiresApi;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.appcompat.widget.Toolbar;
|
||||
import androidx.core.graphics.Insets;
|
||||
import androidx.core.view.ViewCompat;
|
||||
import androidx.core.view.WindowInsetsCompat;
|
||||
|
|
@ -29,6 +30,8 @@ import java.util.Objects;
|
|||
|
||||
public class RomInfo extends AppCompatActivity {
|
||||
|
||||
public static boolean isFinishNow = false;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
|
@ -69,7 +72,7 @@ public class RomInfo extends AppCompatActivity {
|
|||
intent.addCategory(Intent.CATEGORY_OPENABLE);
|
||||
intent.setType("*/*");
|
||||
intent.putExtra(DocumentsContract.EXTRA_INITIAL_URI, Environment.DIRECTORY_DOWNLOADS);
|
||||
startActivity(intent);
|
||||
startActivityForResult(intent, 0);
|
||||
}
|
||||
});
|
||||
|
||||
|
|
@ -86,6 +89,15 @@ public class RomInfo extends AppCompatActivity {
|
|||
if (getIntent().hasExtra("icon")) {
|
||||
Glide.with(this).load(getIntent().getStringExtra("icon")).into(ivIcon);
|
||||
}
|
||||
|
||||
btn_pick.setText(getString(R.string.select) + " " + getIntent().getStringExtra("filename"));
|
||||
}
|
||||
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
if (isFinishNow)
|
||||
finish();
|
||||
isFinishNow = false;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -109,7 +121,7 @@ public class RomInfo extends AppCompatActivity {
|
|||
intent.putExtra("addtodrive", "1");
|
||||
intent.putExtra("romextra", getIntent().getStringExtra("extra"));
|
||||
}
|
||||
intent.putExtra("romicon", AppConfig.maindirpath + "icons/" + getIntent().getStringExtra("title") + ".png");
|
||||
intent.putExtra("romicon", AppConfig.maindirpath + "icons/" + getIntent().getStringExtra("filename") + ".png");
|
||||
switch (Objects.requireNonNull(getIntent().getStringExtra("arch"))) {
|
||||
case "X86_64":
|
||||
MainSettingsManager.setArch(this, "X86_64");
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ import android.view.View;
|
|||
import android.widget.Button;
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.cardview.widget.CardView;
|
||||
|
||||
import com.vectras.qemu.MainSettingsManager;
|
||||
|
||||
|
|
@ -30,12 +31,14 @@ public class SetArchActivity extends AppCompatActivity implements View.OnClickLi
|
|||
Button archppc = findViewById(R.id.archppc);
|
||||
Button web = findViewById(R.id.webBtn);
|
||||
Button buttongetcm = findViewById(R.id.buttongetcm);
|
||||
CardView cdCustom = findViewById(R.id.cdCustom);
|
||||
archi386.setOnClickListener(this);
|
||||
archx86_64.setOnClickListener(this);
|
||||
archarm64.setOnClickListener(this);
|
||||
archppc.setOnClickListener(this);
|
||||
web.setOnClickListener(this);
|
||||
buttongetcm.setOnClickListener(this);
|
||||
cdCustom.setOnClickListener(this);
|
||||
}
|
||||
|
||||
public void onClick(View v) {
|
||||
|
|
@ -70,6 +73,12 @@ public class SetArchActivity extends AppCompatActivity implements View.OnClickLi
|
|||
intent.setAction(Intent.ACTION_VIEW);
|
||||
intent.setData(Uri.parse("android-app://com.anbui.cqcm.app"));
|
||||
startActivity(intent);
|
||||
} else if (id == R.id.cdCustom) {
|
||||
Intent intent = new Intent();
|
||||
intent.setClass(getApplicationContext(), CustomRomActivity.class);
|
||||
intent.putExtra("importcvbinow", "");
|
||||
startActivity(intent);
|
||||
finish();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -18,124 +18,84 @@
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="vertical">
|
||||
|
||||
<androidx.cardview.widget.CardView
|
||||
android:orientation="vertical" >
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/CardViewStyle"
|
||||
app:cardCornerRadius="10dp"
|
||||
app:cardUseCompatPadding="true">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:gravity="center"
|
||||
android:paddingTop="8dp"
|
||||
android:paddingBottom="8dp">
|
||||
<androidx.cardview.widget.CardView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="vertical">
|
||||
style="@style/CardViewStyle"
|
||||
app:cardCornerRadius="10dp"
|
||||
app:cardUseCompatPadding="true">
|
||||
<ImageView
|
||||
android:id="@+id/ivIcon"
|
||||
android:layout_width="84dp"
|
||||
android:layout_height="84dp"
|
||||
android:scaleType="centerCrop" />
|
||||
</androidx.cardview.widget.CardView>
|
||||
<TextView
|
||||
android:id="@+id/textName"
|
||||
style="@android:style/Widget.TextView"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="name"
|
||||
android:textSize="18sp"
|
||||
android:gravity="center"
|
||||
android:padding="8dp"/>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
<TextView
|
||||
android:id="@+id/textSize"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="size"
|
||||
android:textSize="14sp"
|
||||
android:gravity="center" />
|
||||
</LinearLayout>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivIcon"
|
||||
android:layout_width="84dp"
|
||||
android:layout_height="84dp"
|
||||
android:scaleType="fitXY" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:padding="8dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textName"
|
||||
style="@android:style/Widget.TextView"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="name"
|
||||
android:textSize="18sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textSize"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="size"
|
||||
android:textSize="14sp" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal" >
|
||||
<Button
|
||||
android:id="@+id/btn_download"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="8dp"
|
||||
android:text="@string/getit"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_pick"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="8dp"
|
||||
android:text="@string/getit"
|
||||
android:layout_weight="1" />
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
</androidx.cardview.widget.CardView>
|
||||
|
||||
<androidx.cardview.widget.CardView
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/CardViewStyle"
|
||||
app:cardCornerRadius="10dp"
|
||||
app:cardUseCompatPadding="true">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:orientation="horizontal" >
|
||||
<Button
|
||||
android:id="@+id/btn_download"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
android:layout_margin="8dp"
|
||||
android:text="@string/getit"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="vertical"
|
||||
android:padding="8dp">
|
||||
<Button
|
||||
android:id="@+id/btn_pick"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="8dp"
|
||||
android:text="@string/select"
|
||||
android:layout_weight="1" />
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:text="@string/description"
|
||||
android:textSize="18sp"
|
||||
android:textStyle="bold" />
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:text="@string/description"
|
||||
android:textSize="18sp"
|
||||
android:layout_margin="8dp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/descTxt"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:autoLink="all"
|
||||
android:linksClickable="true"
|
||||
android:textIsSelectable="true"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</androidx.cardview.widget.CardView>
|
||||
<TextView
|
||||
android:id="@+id/descTxt"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:autoLink="all"
|
||||
android:linksClickable="true"
|
||||
android:textIsSelectable="true"
|
||||
android:textSize="14sp"
|
||||
android:layout_margin="8dp" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
|
|
|||
|
|
@ -197,7 +197,8 @@
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/continuetext"
|
||||
app:backgroundTint="@drawable/btn_state" />
|
||||
app:backgroundTint="@drawable/btn_state"
|
||||
android:visibility="gone"/>
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
|
|
|||
|
|
@ -109,6 +109,49 @@
|
|||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="1dp"
|
||||
android:background="#9e9e9e"
|
||||
android:layout_marginLeft="8dp"
|
||||
android:layout_marginRight="8dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:layout_marginBottom="16dp" />
|
||||
|
||||
<androidx.cardview.widget.CardView
|
||||
android:id="@+id/cdCustom"
|
||||
style="@style/CardViewStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:clickable="true"
|
||||
android:foreground="?android:attr/selectableItemBackground"
|
||||
android:padding="8dp"
|
||||
app:cardCornerRadius="10dp"
|
||||
app:cardUseCompatPadding="true"
|
||||
android:focusable="true" >
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center_horizontal"
|
||||
android:orientation="vertical"
|
||||
android:rotationX="25">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="48dp"
|
||||
android:layout_height="48dp"
|
||||
android:scaleType="fitXY"
|
||||
android:src="@drawable/input_circle" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="8dp"
|
||||
android:text="@string/importRom" />
|
||||
</LinearLayout>
|
||||
</androidx.cardview.widget.CardView>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
|
|
|
|||
|
|
@ -376,6 +376,7 @@
|
|||
<string name="this_rom_is_missing_too_much_information">يفتقد هذا القرص المضغوط الكثير من المعلومات وقد لا يعمل، ويرجع هذا الخطأ إلى قيام المنشئ بإنشائه بشكل غير صحيح.</string>
|
||||
<string name="this_rom_may_not_be_compatible">قد لا يكون هذا القرص المضغوط متوافقًا لأنه موجود في إصدار أقدم.</string>
|
||||
<string name="please_select">الرجاء الاختيار</string>
|
||||
<string name="select">يختار</string>
|
||||
|
||||
<!--======================TERMUX STRINGS====================-->
|
||||
<string name="application_name">Vterm</string>
|
||||
|
|
|
|||
|
|
@ -378,6 +378,7 @@
|
|||
<string name="this_rom_is_missing_too_much_information">This ROM is missing too much information and it may not work, this error is caused by the person who created it incorrectly.</string>
|
||||
<string name="this_rom_may_not_be_compatible">This ROM may not be compatible as it is for an older version.</string>
|
||||
<string name="please_select">Please select</string>
|
||||
<string name="select">Select</string>
|
||||
|
||||
|
||||
<!--======================TERMUX STRINGS====================-->
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue