diff --git a/app/src/main/java/com/vectras/qemu/MainSettingsManager.java b/app/src/main/java/com/vectras/qemu/MainSettingsManager.java index 605f13c..a7691ff 100644 --- a/app/src/main/java/com/vectras/qemu/MainSettingsManager.java +++ b/app/src/main/java/com/vectras/qemu/MainSettingsManager.java @@ -250,8 +250,8 @@ public class MainSettingsManager extends AppCompatActivity VectrasApp.getApp().setTheme(R.style.AppTheme); } - activity.finish(); startActivity(new Intent(activity, SplashActivity.class)); + activity.finishAffinity(); } @Override diff --git a/app/src/main/java/com/vectras/vm/AboutActivity.java b/app/src/main/java/com/vectras/vm/AboutActivity.java index ab148c2..101b17a 100644 --- a/app/src/main/java/com/vectras/vm/AboutActivity.java +++ b/app/src/main/java/com/vectras/vm/AboutActivity.java @@ -35,6 +35,7 @@ import android.util.Log; import android.view.MenuItem; import android.view.View; import android.widget.Button; +import android.widget.ImageButton; import android.widget.TextView; import android.widget.Toast; @@ -48,7 +49,9 @@ import java.net.URL; public class AboutActivity extends AppCompatActivity implements View.OnClickListener{ - Button btn_osl, btn_clog, btn_discord, btn_youtube, btn_github, btn_telegram, btn_instagram, btn_facebook; + Button btn_osl, btn_clog; + ImageButton btn_discord, btn_youtube, btn_github, btn_telegram, btn_instagram, btn_facebook; + String appInfo; public String TAG = "AboutActivity"; @@ -58,21 +61,21 @@ public class AboutActivity extends AppCompatActivity implements View.OnClickList super.onCreate(savedInstanceState); UIUtils.edgeToEdge(this); setContentView(R.layout.activity_about); - UIUtils.setOnApplyWindowInsetsListener(findViewById(R.id.main)); +// UIUtils.setOnApplyWindowInsetsListener(findViewById(R.id.main)); Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); setSupportActionBar(toolbar); getSupportActionBar().setDisplayHomeAsUpEnabled(true); getSupportActionBar().setDisplayShowHomeEnabled(true); toolbar.setTitle(getResources().getString(R.string.about)); //btn - btn_telegram = (Button) findViewById(R.id.btn_telegram); - btn_youtube = (Button) findViewById(R.id.btn_youtube); - btn_github = (Button) findViewById(R.id.btn_github); - btn_instagram = (Button) findViewById(R.id.btn_instagram); - btn_facebook = (Button) findViewById(R.id.btn_facebook); - btn_discord = (Button) findViewById(R.id.btn_discord); - btn_osl = (Button) findViewById(R.id.btn_osl); - btn_clog = (Button) findViewById(R.id.btn_changelog); + btn_telegram = findViewById(R.id.btn_telegram); + btn_youtube = findViewById(R.id.btn_youtube); + btn_github = findViewById(R.id.btn_github); + btn_instagram = findViewById(R.id.btn_instagram); + btn_facebook = findViewById(R.id.btn_facebook); + btn_discord = findViewById(R.id.btn_discord); + btn_osl = findViewById(R.id.btn_osl); + btn_clog = findViewById(R.id.btn_changelog); //onclicklistener btn_telegram.setOnClickListener(this); btn_github.setOnClickListener(this); @@ -160,12 +163,12 @@ public class AboutActivity extends AppCompatActivity implements View.OnClickList } }); - SimpleAnimations.scale(findViewById(R.id.card_yagiz), 250); - SimpleAnimations.translationUpToDown(findViewById(R.id.card_yagiz), 250); - SimpleAnimations.scale(findViewById(R.id.card_social), 500); - SimpleAnimations.translationUpToDown(findViewById(R.id.card_social), 500); - SimpleAnimations.scale(findViewById(R.id.developers), 750); - SimpleAnimations.translationUpToDown(findViewById(R.id.developers), 750); +// SimpleAnimations.scale(findViewById(R.id.card_yagiz), 250); +// SimpleAnimations.translationUpToDown(findViewById(R.id.card_yagiz), 250); +// SimpleAnimations.scale(findViewById(R.id.card_social), 500); +// SimpleAnimations.translationUpToDown(findViewById(R.id.card_social), 500); +// SimpleAnimations.scale(findViewById(R.id.developers), 750); +// SimpleAnimations.translationUpToDown(findViewById(R.id.developers), 750); } @Override diff --git a/app/src/main/java/com/vectras/vm/CustomRomActivity.java b/app/src/main/java/com/vectras/vm/CustomRomActivity.java index bac837e..e8ad404 100644 --- a/app/src/main/java/com/vectras/vm/CustomRomActivity.java +++ b/app/src/main/java/com/vectras/vm/CustomRomActivity.java @@ -37,6 +37,7 @@ import android.widget.Toast; import androidx.appcompat.app.AlertDialog; import androidx.appcompat.app.AppCompatActivity; import androidx.appcompat.widget.Toolbar; +import androidx.coordinatorlayout.widget.CoordinatorLayout; import androidx.core.app.ActivityCompat; import androidx.core.view.GravityCompat; import androidx.drawerlayout.widget.DrawerLayout; @@ -185,7 +186,7 @@ public class CustomRomActivity extends AppCompatActivity { super.onCreate(savedInstanceState); UIUtils.edgeToEdge(this); setContentView(R.layout.activity_custom_rom); - UIUtils.setOnApplyWindowInsetsListener(findViewById(R.id.main)); +// UIUtils.setOnApplyWindowInsetsListener(findViewById(R.id.main)); activity = this; Toolbar toolbar = findViewById(R.id.toolbar); setSupportActionBar(toolbar); @@ -1205,7 +1206,7 @@ public class CustomRomActivity extends AppCompatActivity { private void whenProcessing(boolean _isProcessing) { AppBarLayout appbar = findViewById(R.id.appbar); - FrameLayout mainlayout = findViewById(R.id.mainlayout); + CoordinatorLayout mainlayout = findViewById(R.id.mainlayout); if (_isProcessing) { mainlayout.setVisibility(View.GONE); appbar.setVisibility(View.GONE); diff --git a/app/src/main/java/com/vectras/vm/RomInfo.java b/app/src/main/java/com/vectras/vm/RomInfo.java index a60c5f6..d03dd83 100644 --- a/app/src/main/java/com/vectras/vm/RomInfo.java +++ b/app/src/main/java/com/vectras/vm/RomInfo.java @@ -39,7 +39,7 @@ public class RomInfo extends AppCompatActivity { super.onCreate(savedInstanceState); EdgeToEdge.enable(this); setContentView(R.layout.activity_rom_info); - UIUtils.setOnApplyWindowInsetsListener(findViewById(R.id.main)); +// UIUtils.setOnApplyWindowInsetsListener(findViewById(R.id.main)); ImageView ivIcon; TextView textName; @@ -47,6 +47,7 @@ public class RomInfo extends AppCompatActivity { Button btn_download; Button btn_pick; TextView descTxt; + Toolbar toolbar; ivIcon = findViewById(R.id.ivIcon); textName = findViewById(R.id.textName); @@ -54,6 +55,12 @@ public class RomInfo extends AppCompatActivity { btn_download = findViewById(R.id.btn_download); btn_pick = findViewById(R.id.btn_pick); descTxt = findViewById(R.id.descTxt); + toolbar = findViewById(R.id.toolbar); + + setSupportActionBar(toolbar); + toolbar.setNavigationOnClickListener(v -> { + onBackPressed(); + }); btn_download.setOnClickListener(v -> { Intent openurl = new Intent(); @@ -85,7 +92,7 @@ public class RomInfo extends AppCompatActivity { } if (getIntent().hasExtra("icon")) { - Glide.with(this).load(getIntent().getStringExtra("icon")).into(ivIcon); + Glide.with(this).load(getIntent().getStringExtra("icon")).placeholder(R.drawable.ic_computer_180dp_with_padding).error(R.drawable.ic_computer_180dp_with_padding).into(ivIcon); } // btn_pick.setText(getString(R.string.select) + " " + getIntent().getStringExtra("filename")); diff --git a/app/src/main/java/com/vectras/vm/Roms/AdapterRoms.java b/app/src/main/java/com/vectras/vm/Roms/AdapterRoms.java index 3c9dafc..8cd05f7 100644 --- a/app/src/main/java/com/vectras/vm/Roms/AdapterRoms.java +++ b/app/src/main/java/com/vectras/vm/Roms/AdapterRoms.java @@ -19,6 +19,7 @@ import android.widget.RadioButton; import android.widget.TextView; import androidx.appcompat.app.AlertDialog; +import androidx.appcompat.content.res.AppCompatResources; import androidx.cardview.widget.CardView; import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; @@ -79,38 +80,38 @@ public class AdapterRoms extends RecyclerView.Adapter { // Get current position of item in recyclerview to bind data and assign values from list final MyHolder myHolder = (MyHolder) holder; final DataRoms current = data.get(position); - Glide.with(RomsManagerActivity.activity).load(current.itemIcon).placeholder(R.drawable.no_machine_image).error(R.drawable.no_machine_image).into(myHolder.ivIcon); + Glide.with(RomsManagerActivity.activity).load(current.itemIcon).placeholder(R.drawable.ic_computer_180dp_with_padding).error(R.drawable.ic_computer_180dp_with_padding).into(myHolder.ivIcon); myHolder.textName.setText(current.itemName); - myHolder.textSize.setText(current.itemSize); + myHolder.textSize.setText(current.itemArch + " - " + current.itemSize); //myHolder.checkBox.setChecked(position == mSelectedItem); if (current.itemAvail) { - if (FileUtils.fileValid(RomsManagerActivity.activity, AppConfig.maindirpath + current.itemPath)) { - //myHolder.checkBox.setEnabled(false); - myHolder.textAvail.setTextColor(Color.BLUE); - myHolder.textAvail.setText(RomsManagerActivity.sInstalled); - } else { - //myHolder.checkBox.setEnabled(true); - myHolder.textAvail.setTextColor(Color.GREEN); - myHolder.textAvail.setText(RomsManagerActivity.sAvailable); - } +// if (FileUtils.fileValid(RomsManagerActivity.activity, AppConfig.maindirpath + current.itemPath)) { +// //myHolder.checkBox.setEnabled(false); +// myHolder.textAvail.setTextColor(Color.BLUE); +// myHolder.textAvail.setText(RomsManagerActivity.sInstalled); +// } else { +// //myHolder.checkBox.setEnabled(true); +// myHolder.textAvail.setTextColor(Color.GREEN); +// myHolder.textAvail.setText(RomsManagerActivity.sAvailable); +// } myHolder.linearItem.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { mSelectedItem = position; notifyItemRangeChanged(0, data.size()); - RomsManagerActivity.selected = true; - RomsManagerActivity.selectedPath = current.itemPath; - RomsManagerActivity.selectedFinalRomFileName = current.itemFinalRomFileName; - RomsManagerActivity.selectedExtra = current.itemExtra; - RomsManagerActivity.selectedName = current.itemName; - RomsManagerActivity.selectedLink = current.itemUrl; - RomsManagerActivity.selectedIcon = current.itemIcon; - RomsManagerActivity.selectedArch = current.itemArch; +// RomsManagerActivity.selected = true; +// RomsManagerActivity.selectedPath = current.itemPath; +// RomsManagerActivity.selectedFinalRomFileName = current.itemFinalRomFileName; +// RomsManagerActivity.selectedExtra = current.itemExtra; +// RomsManagerActivity.selectedName = current.itemName; +// RomsManagerActivity.selectedLink = current.itemUrl; +// RomsManagerActivity.selectedIcon = current.itemIcon; +// RomsManagerActivity.selectedArch = current.itemArch; Intent intent = new Intent(); intent.setClass(RomsManagerActivity.activity, RomInfo.class); intent.putExtra("title", current.itemName); - intent.putExtra("shortdesc", current.itemSize); + intent.putExtra("shortdesc", current.itemArch + " - " + current.itemSize); intent.putExtra("getrom", current.itemUrl); intent.putExtra("desc", current.itemDesc); intent.putExtra("icon", current.itemIcon); @@ -151,6 +152,13 @@ public class AdapterRoms extends RecyclerView.Adapter { //myHolder.checkBox.setEnabled(false); } + if (position == 0) { + myHolder.linearItem.setBackground(AppCompatResources.getDrawable(RomsManagerActivity.activity, R.drawable.object_shape_top)); + } else if (position == data.size() - 1) { + myHolder.linearItem.setBackground(AppCompatResources.getDrawable(RomsManagerActivity.activity, R.drawable.object_shape_bottom)); + } else { + myHolder.linearItem.setBackground(AppCompatResources.getDrawable(RomsManagerActivity.activity, R.drawable.object_shape_middle)); + } } // return total item from List diff --git a/app/src/main/java/com/vectras/vm/RomsManagerActivity.java b/app/src/main/java/com/vectras/vm/RomsManagerActivity.java index f9b20a2..8bf44c8 100644 --- a/app/src/main/java/com/vectras/vm/RomsManagerActivity.java +++ b/app/src/main/java/com/vectras/vm/RomsManagerActivity.java @@ -205,11 +205,11 @@ public class RomsManagerActivity extends AppCompatActivity { //UIUtils.UIAlert(activity, "for first time you need internet connection to load app data!", "No internet connection!"); UIUtils.edgeToEdge(this); setContentView(R.layout.activity_roms_manager); - UIUtils.setOnApplyWindowInsetsListener(findViewById(R.id.main)); +// UIUtils.setOnApplyWindowInsetsListener(findViewById(R.id.main)); linearload = findViewById(R.id.linearload); linearnothinghere = findViewById(R.id.linearnothinghere); buttontryagain = findViewById(R.id.buttontryagain); - loadingPb = findViewById(R.id.loadingPb); +// loadingPb = findViewById(R.id.loadingPb); filterToggle = findViewById(R.id.filterToggle); windowsToggle = findViewById(R.id.windowsToggle); linuxToggle = findViewById(R.id.linuxToggle); diff --git a/app/src/main/res/layout/activity_about.xml b/app/src/main/res/layout/activity_about.xml index 74844bf..880c638 100644 --- a/app/src/main/res/layout/activity_about.xml +++ b/app/src/main/res/layout/activity_about.xml @@ -8,23 +8,44 @@ android:id="@+id/main" > + android:layout_height="wrap_content" + android:gravity="center" + app:layout_behavior="com.google.android.material.appbar.AppBarLayout$Behavior"> - + android:layout_height="?attr/collapsingToolbarLayoutLargeSize" + app:layout_scrollFlags="scroll|exitUntilCollapsed" + android:fitsSystemWindows="true" + app:title="@string/about" + app:collapsedTitleTextAppearance="@style/TextAppearance.Material3.TitleMedium" + app:expandedTitleTextAppearance="@style/TextAppearance.Material3.DisplaySmall"> + + + + + android:orientation="horizontal" + app:layout_anchor="@+id/linearLayout" + app:layout_anchorGravity="center"> - - - - - - - - + android:layout_height="match_parent" + android:fitsSystemWindows="true"> - + android:layout_height="wrap_content" + android:gravity="center" + app:layout_behavior="com.google.android.material.appbar.AppBarLayout$Behavior"> + + + + + + + + + - + - + + android:gravity="center" + android:fitsSystemWindows="true"> - - + android:layout_height="wrap_content" + android:gravity="center" + app:layout_behavior="com.google.android.material.appbar.AppBarLayout$Behavior"> + + + + + + + + + - - + - + - \ No newline at end of file + \ No newline at end of file diff --git a/app/src/main/res/layout/activity_roms_manager.xml b/app/src/main/res/layout/activity_roms_manager.xml index e85f6fa..9d1b72d 100644 --- a/app/src/main/res/layout/activity_roms_manager.xml +++ b/app/src/main/res/layout/activity_roms_manager.xml @@ -3,27 +3,9 @@ xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" - android:fitsSystemWindows="true" android:orientation="vertical" android:id="@+id/main" > - - - - - - - + + + + + + + + + + + + android:layout_height="match_parent" + android:fillViewport="true" + app:layout_behavior="@string/appbar_scrolling_view_behavior" + android:layout_marginTop="1dp"/> - + + + android:layout_height="wrap_content"> - diff --git a/app/src/main/res/layout/container_roms.xml b/app/src/main/res/layout/container_roms.xml index d012f98..2619cdd 100644 --- a/app/src/main/res/layout/container_roms.xml +++ b/app/src/main/res/layout/container_roms.xml @@ -21,20 +21,23 @@ android:paddingTop="2dp" android:paddingBottom="2dp" android:gravity="center_vertical" - android:background="?android:attr/selectableItemBackground" > + android:background="?android:attr/selectableItemBackground" + android:layout_marginTop="2dp" + android:layout_marginLeft="8dp" + android:layout_marginRight="8dp"> - + app:cardCornerRadius="15dp"> - + android:src="@drawable/ic_computer_180dp_with_padding"/> + + android:textSize="16sp" /> @@ -62,16 +65,16 @@ android:layout_height="wrap_content" android:maxLines="1" android:text="@string/size" - android:textSize="15sp" - android:layout_marginTop="8dp" - android:layout_marginBottom="8dp"/> + android:textSize="12sp" + android:layout_marginTop="4dp" + android:layout_marginBottom="4dp"/> diff --git a/app/src/main/res/layout/content_about.xml b/app/src/main/res/layout/content_about.xml index e51c9c9..9d6e859 100644 --- a/app/src/main/res/layout/content_about.xml +++ b/app/src/main/res/layout/content_about.xml @@ -3,6 +3,7 @@ xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="match_parent" + android:fillViewport="true" app:layout_behavior="@string/appbar_scrolling_view_behavior"> - - + - -