mirror of
https://gitee.com/zhangsken/AndroidIDE.git
synced 2026-10-16 07:49:44 +08:00
feat: various design improvements (#1023)
* refactor: A bunch of (mostly XML) styling * fix(Main Activity): Make use of a dedicated Splash Activity to enable Dynamic coloring in MainActivity * feat(edge-to-edge): Ground work to support edge-to-edge experiences throughout the IDE * fix(edge-to-edge): Manually set bottom padding for fragment containment * feat(edge-to-edge): Allow full activity rebuild on configuration changes for MainActivity. This allows to ship more specific layout changes and is a ground work to support split screen mode. * Bug introduced: templates are not shown in the TemplateListFragment after full activity rebuild * fix: Finish the Splash Activity after launching the Main one * fix(templates): The list of templates no longer disappears after an activity rebuild or a configuration change * fix(templates): Keep OnGlobalLayoutListener attached while the View is alive. This ensures that the last item in template list is always aligned to the start. * feat(design): Custom layout for MainActivity's main fragment in landscape mode * feat(edge-to-edge): Implement edge-to-edge for PreferencesActivity, move InsetUtils outside of the LimitlessIDEActivity. * refactor(IDEPreferencesFragment.kt): Comply with the line-length rule, fix a one-line if statement to follow the general codestyle * refactor(edge-to-edge): Remove PaddingUtils.kt The reasoning behind this is that after `view.setPadding(left, top, right, bottom)` is executed, `view.getPaddingBottom()` (or for any other side) still returns the old value of padding before the view is measured again. Therefore the implementation of PaddingUtils.kt produces an unwanted and unexpected behaviour. * feat(edge-to-edge): Create a BottomInsetHeightDistributor view * fix(templates/design): Use OutlinedButton style for the *Exit* button inside the *New project* wizard's footer * refactor: Comply with AndroidIDE's code style * refactor: Make use of helper methods. Optimize XML * fix(edge-to-edge): Wrong system bar coloring in Dark Mode
This commit is contained in:
Generated
+1
-1
@@ -1,5 +1,5 @@
|
||||
<component name="ProjectCodeStyleConfiguration">
|
||||
<state>
|
||||
<option name="PREFERRED_PROJECT_CODE_STYLE" value="AndroidIDEStyle" />
|
||||
<option name="USE_PER_PROJECT_SETTINGS" value="true" />
|
||||
</state>
|
||||
</component>
|
||||
Generated
+1
@@ -1,3 +1,4 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ANTLRGenerationPreferences">
|
||||
<option name="perGrammarGenerationSettings">
|
||||
|
||||
@@ -44,8 +44,7 @@
|
||||
</intent-filter>
|
||||
</activity>
|
||||
<activity
|
||||
android:name=".activities.MainActivity"
|
||||
android:configChanges="orientation|screenSize"
|
||||
android:name=".activities.SplashActivity"
|
||||
android:exported="true"
|
||||
android:theme="@style/AppTheme.Splash">
|
||||
<intent-filter>
|
||||
@@ -53,14 +52,16 @@
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
<activity
|
||||
android:name=".activities.MainActivity"
|
||||
android:exported="false"
|
||||
android:theme="@style/Theme.AndroidIDE"/>
|
||||
<activity
|
||||
android:name=".activities.editor.EditorActivityKt"
|
||||
android:configChanges="orientation|screenSize"
|
||||
android:launchMode="singleTop"
|
||||
android:windowSoftInputMode="adjustResize" />
|
||||
<activity
|
||||
android:name=".activities.PreferencesActivity"
|
||||
android:configChanges="orientation|screenSize" />
|
||||
<activity android:name=".activities.PreferencesActivity" />
|
||||
<activity
|
||||
android:name=".activities.AboutActivity"
|
||||
android:configChanges="orientation|screenSize" />
|
||||
|
||||
@@ -14,21 +14,19 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with AndroidIDE. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.itsaky.androidide.activities;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
|
||||
import androidx.appcompat.widget.TooltipCompat;
|
||||
import androidx.core.util.Pair;
|
||||
|
||||
import com.google.android.gms.oss.licenses.OssLicensesMenuActivity;
|
||||
import com.itsaky.androidide.R;
|
||||
import com.itsaky.androidide.app.IDEActivity;
|
||||
import com.itsaky.androidide.databinding.ActivityAboutBinding;
|
||||
import com.itsaky.androidide.databinding.LayoutAboutItemsBinding;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
@@ -14,12 +14,15 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with AndroidIDE. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.itsaky.androidide.activities
|
||||
|
||||
import android.content.Intent
|
||||
import android.graphics.Rect
|
||||
import android.os.Bundle
|
||||
import android.text.TextUtils
|
||||
import android.text.method.LinkMovementMethod
|
||||
import android.util.Log
|
||||
import android.view.View
|
||||
import android.widget.TextView
|
||||
import androidx.activity.OnBackPressedCallback
|
||||
@@ -34,7 +37,7 @@ import com.google.android.material.color.DynamicColors
|
||||
import com.google.android.material.transition.MaterialSharedAxis
|
||||
import com.itsaky.androidide.activities.editor.EditorActivityKt
|
||||
import com.itsaky.androidide.app.BaseApplication
|
||||
import com.itsaky.androidide.app.IDEActivity
|
||||
import com.itsaky.androidide.app.LimitlessIDEActivity
|
||||
import com.itsaky.androidide.databinding.ActivityMainBinding
|
||||
import com.itsaky.androidide.preferences.internal.NO_OPENED_PROJECT
|
||||
import com.itsaky.androidide.preferences.internal.autoOpenProjects
|
||||
@@ -53,7 +56,7 @@ import com.itsaky.androidide.viewmodel.MainViewModel.Companion.SCREEN_TEMPLATE_D
|
||||
import com.itsaky.androidide.viewmodel.MainViewModel.Companion.SCREEN_TEMPLATE_LIST
|
||||
import java.io.File
|
||||
|
||||
class MainActivity : IDEActivity() {
|
||||
class MainActivity : LimitlessIDEActivity() {
|
||||
|
||||
private val viewModel by viewModels<MainViewModel>()
|
||||
private var _binding: ActivityMainBinding? = null
|
||||
@@ -109,10 +112,24 @@ class MainActivity : IDEActivity() {
|
||||
}
|
||||
}
|
||||
|
||||
viewModel.setScreen(SCREEN_MAIN)
|
||||
Log.d("MainActivity", "Current screen: ${viewModel.currentScreen.value}")
|
||||
Log.d("MainActivity", "Previous screen: ${viewModel.previousScreen}")
|
||||
|
||||
onBackPressedDispatcher.addCallback(/* owner = */
|
||||
this, /* onBackPressedCallback = */ onBackPressedCallback)
|
||||
// Data in a ViewModel is kept between activity rebuilds on
|
||||
// configuration changes (i.e. screen rotation)
|
||||
// * previous == -1 and current == -1 -> this is an initial instantiation of the activity
|
||||
if (viewModel.currentScreen.value == -1 && viewModel.previousScreen == -1) {
|
||||
viewModel.setScreen(SCREEN_MAIN)
|
||||
} else {
|
||||
onScreenChanged(viewModel.currentScreen.value)
|
||||
}
|
||||
|
||||
onBackPressedDispatcher.addCallback(this, onBackPressedCallback)
|
||||
}
|
||||
|
||||
override fun onInsetsUpdated(insets: Rect) {
|
||||
super.onInsetsUpdated(insets)
|
||||
binding.fragmentContainersParent.setPadding(insets.left, 0, insets.right, insets.bottom)
|
||||
}
|
||||
|
||||
override fun onStart() {
|
||||
@@ -130,13 +147,18 @@ class MainActivity : IDEActivity() {
|
||||
private fun onScreenChanged(screen: Int?) {
|
||||
val previous = viewModel.previousScreen
|
||||
if (previous != -1) {
|
||||
val axis =
|
||||
// template list -> template details
|
||||
// ------- OR -------
|
||||
// template details -> template list
|
||||
if ((previous == SCREEN_TEMPLATE_LIST || previous == SCREEN_TEMPLATE_DETAILS) && (screen == SCREEN_TEMPLATE_LIST || screen == SCREEN_TEMPLATE_DETAILS)) {
|
||||
MaterialSharedAxis.X
|
||||
} else MaterialSharedAxis.Y
|
||||
// template list -> template details
|
||||
// ------- OR -------
|
||||
// template details -> template list
|
||||
val setAxisToX =
|
||||
(previous == SCREEN_TEMPLATE_LIST || previous == SCREEN_TEMPLATE_DETAILS) &&
|
||||
(screen == SCREEN_TEMPLATE_LIST || screen == SCREEN_TEMPLATE_DETAILS)
|
||||
|
||||
val axis = if (setAxisToX) {
|
||||
MaterialSharedAxis.X
|
||||
} else {
|
||||
MaterialSharedAxis.Y
|
||||
}
|
||||
|
||||
val isForward = when {
|
||||
previous == SCREEN_MAIN && screen == SCREEN_TEMPLATE_LIST -> true
|
||||
@@ -144,14 +166,15 @@ class MainActivity : IDEActivity() {
|
||||
previous == SCREEN_TEMPLATE_DETAILS && screen == SCREEN_TEMPLATE_LIST -> false
|
||||
previous == SCREEN_TEMPLATE_DETAILS && screen == SCREEN_MAIN -> false
|
||||
previous == SCREEN_TEMPLATE_LIST && screen == SCREEN_MAIN -> false
|
||||
else -> throw IllegalStateException("Invalid screen states")
|
||||
else -> throw IllegalStateException(
|
||||
"Invalid screen states. Previous: $previous Current: $screen"
|
||||
)
|
||||
}
|
||||
|
||||
val transition = MaterialSharedAxis(axis, isForward)
|
||||
transition.doOnEnd {
|
||||
viewModel.isTransitionInProgress = false
|
||||
onBackPressedCallback.isEnabled =
|
||||
viewModel.currentScreen.value != SCREEN_MAIN
|
||||
onBackPressedCallback.isEnabled = viewModel.currentScreen.value != SCREEN_MAIN
|
||||
}
|
||||
|
||||
viewModel.isTransitionInProgress = true
|
||||
@@ -165,8 +188,7 @@ class MainActivity : IDEActivity() {
|
||||
else -> throw IllegalArgumentException("Invalid screen id: '$screen'")
|
||||
}
|
||||
|
||||
for (fragment in arrayOf(binding.main, binding.templateList,
|
||||
binding.templateDetails)) {
|
||||
for (fragment in arrayOf(binding.main, binding.templateList, binding.templateDetails)) {
|
||||
fragment.isVisible = fragment == currentFragment
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,27 +17,29 @@
|
||||
|
||||
package com.itsaky.androidide.activities;
|
||||
|
||||
import android.graphics.Rect;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.fragment.app.Fragment;
|
||||
|
||||
import com.itsaky.androidide.R;
|
||||
import com.itsaky.androidide.app.IDEActivity;
|
||||
import com.itsaky.androidide.app.LimitlessIDEActivity;
|
||||
import com.itsaky.androidide.databinding.ActivityPreferencesBinding;
|
||||
import com.itsaky.androidide.fragments.IDEPreferencesFragment;
|
||||
import com.itsaky.androidide.preferences.AboutPreferences;
|
||||
import com.itsaky.androidide.preferences.ConfigurationPreferences;
|
||||
import com.itsaky.androidide.preferences.IDEPreferences;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class PreferencesActivity extends IDEActivity {
|
||||
public class PreferencesActivity extends LimitlessIDEActivity {
|
||||
|
||||
private ActivityPreferencesBinding binding;
|
||||
private IDEPreferencesFragment rootFragment;
|
||||
|
||||
public PreferencesActivity() {
|
||||
super(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
@@ -47,11 +49,11 @@ public class PreferencesActivity extends IDEActivity {
|
||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||
|
||||
binding.toolbar.setNavigationOnClickListener(v -> onBackPressed());
|
||||
|
||||
|
||||
if (savedInstanceState != null) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
final var prefs = IDEPreferences.INSTANCE;
|
||||
prefs.getChildren().clear();
|
||||
prefs.addPreference(new ConfigurationPreferences());
|
||||
@@ -59,14 +61,38 @@ public class PreferencesActivity extends IDEActivity {
|
||||
|
||||
final var args = new Bundle();
|
||||
args.putParcelableArrayList(
|
||||
IDEPreferencesFragment.EXTRA_CHILDREN, new ArrayList<>(prefs.getChildren()));
|
||||
|
||||
IDEPreferencesFragment.EXTRA_CHILDREN,
|
||||
new ArrayList<>(prefs.getChildren())
|
||||
);
|
||||
|
||||
final var root = getRootFragment();
|
||||
root.setArguments(args);
|
||||
loadFragment(root);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onInsetsUpdated(@NonNull Rect insets) {
|
||||
super.onInsetsUpdated(insets);
|
||||
|
||||
View toolbar = binding.toolbar;
|
||||
toolbar.setPadding(
|
||||
toolbar.getPaddingLeft() + insets.left,
|
||||
toolbar.getPaddingTop(),
|
||||
toolbar.getPaddingRight() + insets.right,
|
||||
toolbar.getPaddingBottom()
|
||||
);
|
||||
|
||||
View fragmentContainer = binding.fragmentContainerParent;
|
||||
fragmentContainer.setPadding(
|
||||
fragmentContainer.getPaddingLeft() + insets.left,
|
||||
fragmentContainer.getPaddingTop(),
|
||||
fragmentContainer.getPaddingRight() + insets.right,
|
||||
fragmentContainer.getPaddingBottom()
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
@NonNull
|
||||
protected View bindLayout() {
|
||||
binding = ActivityPreferencesBinding.inflate(getLayoutInflater());
|
||||
return binding.getRoot();
|
||||
@@ -76,8 +102,8 @@ public class PreferencesActivity extends IDEActivity {
|
||||
return rootFragment == null ? rootFragment = new IDEPreferencesFragment() : rootFragment;
|
||||
}
|
||||
|
||||
private void loadFragment(Fragment frag) {
|
||||
super.loadFragment(frag, binding.fragmentContainer.getId());
|
||||
private void loadFragment(Fragment fragment) {
|
||||
super.loadFragment(fragment, binding.fragmentContainer.getId());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
/*
|
||||
* This file is part of AndroidIDE.
|
||||
*
|
||||
* AndroidIDE is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* AndroidIDE is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with AndroidIDE. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.itsaky.androidide.activities
|
||||
|
||||
import android.app.Activity
|
||||
import android.content.Intent
|
||||
import android.os.Bundle
|
||||
|
||||
class SplashActivity : Activity() {
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
startActivity(Intent(this, MainActivity::class.java))
|
||||
finish()
|
||||
}
|
||||
|
||||
}
|
||||
@@ -156,11 +156,17 @@ abstract class BaseEditorActivity :
|
||||
}
|
||||
|
||||
protected abstract fun provideCurrentEditor(): CodeEditorView?
|
||||
|
||||
protected abstract fun provideEditorAt(index: Int): CodeEditorView?
|
||||
|
||||
protected abstract fun doOpenFile(file: File, selection: Range?)
|
||||
|
||||
protected abstract fun doSaveAll(): Boolean
|
||||
|
||||
protected abstract fun doDismissSearchProgress()
|
||||
|
||||
protected abstract fun doConfirmProjectClose()
|
||||
|
||||
protected abstract fun getOpenedFiles(): List<OpenedFile>
|
||||
|
||||
protected open fun preDestroy() {
|
||||
|
||||
@@ -23,7 +23,6 @@ import android.view.ViewGroup
|
||||
import androidx.recyclerview.widget.DiffUtil
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.blankj.utilcode.util.ConvertUtils
|
||||
import com.google.android.flexbox.FlexboxLayoutManager
|
||||
import com.google.android.material.shape.CornerFamily
|
||||
import com.itsaky.androidide.adapters.TemplateListAdapter.ViewHolder
|
||||
import com.itsaky.androidide.databinding.LayoutTemplateListItemBinding
|
||||
@@ -34,7 +33,9 @@ import com.itsaky.androidide.templates.Template
|
||||
*
|
||||
* @author Akash Yadav
|
||||
*/
|
||||
class TemplateListAdapter(templates: List<Template<*>>, private val onClick: ((Template<*>, ViewHolder) -> Unit)? = null
|
||||
class TemplateListAdapter(
|
||||
templates: List<Template<*>>,
|
||||
private val onClick: ((Template<*>, ViewHolder) -> Unit)? = null
|
||||
) : RecyclerView.Adapter<ViewHolder>() {
|
||||
|
||||
private val templates = templates.toMutableList()
|
||||
@@ -42,11 +43,12 @@ class TemplateListAdapter(templates: List<Template<*>>, private val onClick: ((T
|
||||
class ViewHolder(internal val binding: LayoutTemplateListItemBinding) :
|
||||
RecyclerView.ViewHolder(binding.root)
|
||||
|
||||
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int
|
||||
): ViewHolder {
|
||||
return ViewHolder(
|
||||
LayoutTemplateListItemBinding.inflate(LayoutInflater.from(parent.context),
|
||||
parent, false))
|
||||
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder {
|
||||
return ViewHolder(LayoutTemplateListItemBinding.inflate(
|
||||
LayoutInflater.from(parent.context),
|
||||
parent,
|
||||
false
|
||||
))
|
||||
}
|
||||
|
||||
override fun getItemCount(): Int {
|
||||
@@ -88,17 +90,15 @@ class TemplateListAdapter(templates: List<Template<*>>, private val onClick: ((T
|
||||
return count + extras
|
||||
}
|
||||
|
||||
override fun areItemsTheSame(oldItemPosition: Int, newItemPosition: Int
|
||||
): Boolean {
|
||||
override fun areItemsTheSame(oldItemPosition: Int, newItemPosition: Int): Boolean {
|
||||
return newItemPosition < count && oldItemPosition == newItemPosition
|
||||
}
|
||||
|
||||
override fun areContentsTheSame(oldItemPosition: Int, newItemPosition: Int
|
||||
): Boolean {
|
||||
override fun areContentsTheSame(oldItemPosition: Int, newItemPosition: Int): Boolean {
|
||||
return areItemsTheSame(oldItemPosition, newItemPosition)
|
||||
}
|
||||
})
|
||||
|
||||
diff.dispatchUpdatesTo(this)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,8 +17,6 @@
|
||||
|
||||
package com.itsaky.androidide.app
|
||||
|
||||
import android.os.Bundle
|
||||
import androidx.appcompat.app.AppCompatDelegate
|
||||
import androidx.appcompat.app.AppCompatDelegate.getDefaultNightMode
|
||||
import androidx.appcompat.app.AppCompatDelegate.setDefaultNightMode
|
||||
import com.itsaky.androidide.eventbus.events.preferences.PreferenceChangeEvent
|
||||
@@ -29,11 +27,10 @@ import org.greenrobot.eventbus.Subscribe
|
||||
import org.greenrobot.eventbus.ThreadMode.MAIN
|
||||
|
||||
abstract class IDEActivity : BaseIDEActivity() {
|
||||
|
||||
val app: IDEApplication
|
||||
get() = application as IDEApplication
|
||||
|
||||
|
||||
|
||||
|
||||
override fun onStart() {
|
||||
super.onStart()
|
||||
EventBus.getDefault().register(this)
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
* along with AndroidIDE. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
package com.itsaky.androidide.app
|
||||
|
||||
import android.content.Intent
|
||||
@@ -75,7 +76,7 @@ class IDEApplication : BaseApplication() {
|
||||
AppCompatDelegate.setDefaultNightMode(uiMode)
|
||||
|
||||
if (enableMaterialYou) {
|
||||
DynamicColors.applyToActivitiesIfAvailable(this)
|
||||
DynamicColors.applyToActivitiesIfAvailable(this)
|
||||
}
|
||||
|
||||
EditorColorScheme.setDefault(SchemeAndroidIDE.newInstance(null))
|
||||
|
||||
@@ -0,0 +1,98 @@
|
||||
/*
|
||||
* This file is part of AndroidIDE.
|
||||
*
|
||||
* AndroidIDE is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* AndroidIDE is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with AndroidIDE. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.itsaky.androidide.app
|
||||
|
||||
import android.content.res.Configuration
|
||||
import android.graphics.Color
|
||||
import android.graphics.Rect
|
||||
import android.os.Build
|
||||
import android.os.Bundle
|
||||
import android.os.PersistableBundle
|
||||
import android.view.WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_SHORT_EDGES
|
||||
import androidx.core.view.WindowCompat
|
||||
import androidx.core.view.doOnAttach
|
||||
import com.itsaky.androidide.utils.NavigationBar
|
||||
import com.itsaky.androidide.utils.getInsets
|
||||
import com.itsaky.androidide.utils.resolveAttr
|
||||
|
||||
/**
|
||||
* Same as IDEActivity but DecorFitsSystemWindows is set to false
|
||||
* Useful for creating immersive edge-to-edge experiences
|
||||
*
|
||||
* @author Smooth E
|
||||
*/
|
||||
abstract class LimitlessIDEActivity(
|
||||
private val highlightNavigationBar: Boolean = false
|
||||
) : IDEActivity() {
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
makeLimitless()
|
||||
installOnDecorViewAttachedListener()
|
||||
}
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?, persistentState: PersistableBundle?) {
|
||||
super.onCreate(savedInstanceState, persistentState)
|
||||
makeLimitless()
|
||||
installOnDecorViewAttachedListener()
|
||||
}
|
||||
|
||||
private fun makeLimitless() {
|
||||
WindowCompat.setDecorFitsSystemWindows(window, false)
|
||||
|
||||
paintNavigationBar()
|
||||
|
||||
// This removes a black strip on the side where the camera cutout is in landscape mode
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
|
||||
window.attributes.layoutInDisplayCutoutMode = LAYOUT_IN_DISPLAY_CUTOUT_MODE_SHORT_EDGES
|
||||
}
|
||||
}
|
||||
|
||||
private fun installOnDecorViewAttachedListener() {
|
||||
window.decorView.doOnAttach { decorView -> onInsetsUpdated(getInsets(decorView)) }
|
||||
}
|
||||
|
||||
/** Called whenever insets are updated */
|
||||
open fun onInsetsUpdated(insets: Rect) { }
|
||||
|
||||
private fun paintNavigationBar() {
|
||||
window.statusBarColor = Color.TRANSPARENT
|
||||
window.navigationBarColor = Color.TRANSPARENT
|
||||
|
||||
if (!highlightNavigationBar) {
|
||||
return
|
||||
}
|
||||
|
||||
val refrainHighlighting =
|
||||
NavigationBar.getInteractionMode(this) == NavigationBar.MODE_GESTURES ||
|
||||
resources.configuration.orientation == Configuration.ORIENTATION_LANDSCAPE
|
||||
|
||||
if (refrainHighlighting) {
|
||||
return
|
||||
}
|
||||
|
||||
val navigationBarColor = resolveAttr(com.google.android.material.R.attr.colorSurface)
|
||||
window.navigationBarColor = navigationBarColor
|
||||
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
|
||||
val dividerColor = resolveAttr(com.google.android.material.R.attr.colorOutlineVariant)
|
||||
window.navigationBarDividerColor = dividerColor
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -14,6 +14,7 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with AndroidIDE. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.itsaky.androidide.fragments
|
||||
|
||||
import android.os.Bundle
|
||||
@@ -30,8 +31,12 @@ import com.itsaky.androidide.preferences.IPreferenceScreen
|
||||
class IDEPreferencesFragment : BasePreferenceFragment() {
|
||||
|
||||
private var children: List<IPreference> = emptyList()
|
||||
|
||||
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View {
|
||||
|
||||
override fun onCreateView(
|
||||
inflater: LayoutInflater,
|
||||
container: ViewGroup?,
|
||||
savedInstanceState: Bundle?
|
||||
): View {
|
||||
enterTransition = MaterialSharedAxis(MaterialSharedAxis.X, true)
|
||||
reenterTransition = MaterialSharedAxis(MaterialSharedAxis.X, false)
|
||||
exitTransition = MaterialSharedAxis(MaterialSharedAxis.X, true)
|
||||
@@ -40,7 +45,10 @@ class IDEPreferencesFragment : BasePreferenceFragment() {
|
||||
|
||||
override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) {
|
||||
super.onCreatePreferences(savedInstanceState, rootKey)
|
||||
if (context == null) return
|
||||
|
||||
if (context == null) {
|
||||
return
|
||||
}
|
||||
|
||||
@Suppress("DEPRECATION")
|
||||
this.children = arguments?.getParcelableArrayList(EXTRA_CHILDREN) ?: emptyList()
|
||||
@@ -70,6 +78,7 @@ class IDEPreferencesFragment : BasePreferenceFragment() {
|
||||
}
|
||||
|
||||
companion object {
|
||||
|
||||
const val EXTRA_CHILDREN = "idepref_children"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -38,26 +38,26 @@ import kotlin.math.ceil
|
||||
* @author Akash Yadav
|
||||
*/
|
||||
class TemplateListFragment : FragmentWithBinding<FragmentTemplateListBinding>(
|
||||
R.layout.fragment_template_list, FragmentTemplateListBinding::bind) {
|
||||
R.layout.fragment_template_list, FragmentTemplateListBinding::bind
|
||||
) {
|
||||
|
||||
private var adapter: TemplateListAdapter? = null
|
||||
private var layoutManager: FlexboxLayoutManager? = null
|
||||
|
||||
private val viewModel by viewModels<MainViewModel>(
|
||||
ownerProducer = { requireActivity() })
|
||||
private lateinit var globalLayoutListener: OnGlobalLayoutListener
|
||||
|
||||
private val viewModel by viewModels<MainViewModel>(ownerProducer = { requireActivity() })
|
||||
|
||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||
super.onViewCreated(view, savedInstanceState)
|
||||
|
||||
// Show only project templates
|
||||
val templates = ITemplateProvider.getInstance()
|
||||
val templates = ITemplateProvider.getInstance(true)
|
||||
.getTemplates()
|
||||
.filterIsInstance<ProjectTemplate>()
|
||||
|
||||
layoutManager =
|
||||
FlexboxLayoutManager(requireContext(), FlexDirection.ROW).apply {
|
||||
justifyContent = JustifyContent.SPACE_EVENLY
|
||||
}
|
||||
layoutManager = FlexboxLayoutManager(requireContext(), FlexDirection.ROW)
|
||||
layoutManager!!.justifyContent = JustifyContent.SPACE_EVENLY
|
||||
|
||||
adapter = TemplateListAdapter(templates) { template, _ ->
|
||||
viewModel.template.value = template
|
||||
@@ -69,16 +69,12 @@ class TemplateListFragment : FragmentWithBinding<FragmentTemplateListBinding>(
|
||||
|
||||
// This makes sure that the items are evenly distributed in the list
|
||||
// and the last row is always aligned to the start
|
||||
binding.list.viewTreeObserver.addOnGlobalLayoutListener(object :
|
||||
OnGlobalLayoutListener {
|
||||
globalLayoutListener = object : OnGlobalLayoutListener {
|
||||
override fun onGlobalLayout() {
|
||||
binding.list.viewTreeObserver.removeOnGlobalLayoutListener(this)
|
||||
|
||||
val adapter = this@TemplateListFragment.adapter ?: return
|
||||
val layoutManager = this@TemplateListFragment.layoutManager ?: return
|
||||
|
||||
val columns =
|
||||
layoutManager.flexLinesInternal.firstOrNull()?.itemCount ?: 0
|
||||
val columns = layoutManager.flexLinesInternal.firstOrNull()?.itemCount ?: 0
|
||||
if (columns == 0) {
|
||||
return
|
||||
}
|
||||
@@ -96,10 +92,17 @@ class TemplateListFragment : FragmentWithBinding<FragmentTemplateListBinding>(
|
||||
|
||||
adapter.fillDiff(diff)
|
||||
}
|
||||
})
|
||||
}
|
||||
binding.list.viewTreeObserver.addOnGlobalLayoutListener(globalLayoutListener)
|
||||
|
||||
binding.exitButton.setOnClickListener {
|
||||
viewModel.setScreen(MainViewModel.SCREEN_MAIN)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun onDestroyView() {
|
||||
binding.list.viewTreeObserver.removeOnGlobalLayoutListener(globalLayoutListener)
|
||||
super.onDestroyView()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -22,7 +22,6 @@ import androidx.lifecycle.LiveData
|
||||
import androidx.lifecycle.MutableLiveData
|
||||
import androidx.lifecycle.Observer
|
||||
import androidx.lifecycle.ViewModel
|
||||
import com.itsaky.androidide.templates.ProjectTemplate
|
||||
import com.itsaky.androidide.templates.Template
|
||||
import java.util.concurrent.atomic.AtomicInteger
|
||||
|
||||
@@ -49,6 +48,7 @@ class MainViewModel : ViewModel() {
|
||||
internal val creatingProject = MutableLiveData(false)
|
||||
|
||||
val currentScreen: LiveData<Int> = _currentScreen
|
||||
|
||||
val previousScreen: Int
|
||||
get() = _previousScreen.get()
|
||||
|
||||
@@ -71,6 +71,8 @@ class MainViewModel : ViewModel() {
|
||||
action.run()
|
||||
}
|
||||
})
|
||||
} else action.run()
|
||||
} else {
|
||||
action.run()
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,90 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<!--
|
||||
~ This file is part of AndroidIDE.
|
||||
~
|
||||
~ AndroidIDE is free software: you can redistribute it and/or modify
|
||||
~ it under the terms of the GNU General Public License as published by
|
||||
~ the Free Software Foundation, either version 3 of the License, or
|
||||
~ (at your option) any later version.
|
||||
~
|
||||
~ AndroidIDE is distributed in the hope that it will be useful,
|
||||
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
~ GNU General Public License for more details.
|
||||
~
|
||||
~ You should have received a copy of the GNU General Public License
|
||||
~ along with AndroidIDE. If not, see <https://www.gnu.org/licenses/>.
|
||||
-->
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/coordinator"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:layout_behavior="com.google.android.material.appbar.AppBarLayout$ScrollingViewBehavior">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/greeting"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@id/actions"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent">
|
||||
|
||||
<com.google.android.material.imageview.ShapeableImageView
|
||||
android:id="@+id/main_image"
|
||||
android:layout_width="50dp"
|
||||
android:layout_height="50dp"
|
||||
android:layout_margin="16dp"
|
||||
android:src="@drawable/ic_launcher_main"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintVertical_bias="0.15"
|
||||
app:shapeAppearance="@style/AppTheme.ShapeAppearance.MainFragment.Logo" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/getStarted"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="4dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginEnd="4dp"
|
||||
android:layout_marginBottom="4dp"
|
||||
android:text="@string/get_started"
|
||||
android:textAppearance="@style/TextAppearance.Material3.TitleMedium"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/main_image" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/greetingText"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="16dp"
|
||||
android:text="@string/msg_create_new_project_greeting"
|
||||
android:textAppearance="@style/TextAppearance.Material3.BodyMedium"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/getStarted" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/actions"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintStart_toEndOf="@id/greeting"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
|
||||
tools:listitem="@layout/layout_main_action_item" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -1,4 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?><!--
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<!--
|
||||
~ This file is part of AndroidIDE.
|
||||
~
|
||||
~ AndroidIDE is free software: you can redistribute it and/or modify
|
||||
@@ -14,11 +16,13 @@
|
||||
~ You should have received a copy of the GNU General Public License
|
||||
~ along with AndroidIDE. If not, see <https://www.gnu.org/licenses/>.
|
||||
-->
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/root"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:context=".activities.CrashHandlerActivity">
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/root"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:context=".activities.CrashHandlerActivity">
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<com.itsaky.androidide.ui.ContentTranslatingDrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<com.itsaky.androidide.ui.ContentTranslatingDrawerLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/editor_drawerLayout"
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
@@ -11,61 +12,49 @@
|
||||
<com.google.android.material.appbar.AppBarLayout
|
||||
android:id="@+id/appbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="?attr/actionBarSize"
|
||||
android:gravity="center"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_behavior="com.google.android.material.appbar.AppBarLayout$Behavior"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
android:fitsSystemWindows="true">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/toolbar_header"
|
||||
<com.google.android.material.appbar.MaterialToolbar
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerInParent="true"
|
||||
android:clickable="false"
|
||||
android:focusable="false"
|
||||
android:gravity="center"
|
||||
android:text="@string/app_name"
|
||||
android:textAppearance="@style/TextAppearance.Material3.TitleLarge"
|
||||
android:textStyle="bold" />
|
||||
|
||||
</RelativeLayout>
|
||||
android:layout_height="?attr/actionBarSize"
|
||||
app:title="@string/app_name"
|
||||
app:titleTextAppearance="@style/TextAppearance.AndroidIDE.TitleLarge.Bold"
|
||||
app:titleCentered="true" />
|
||||
|
||||
</com.google.android.material.appbar.AppBarLayout>
|
||||
|
||||
<androidx.fragment.app.FragmentContainerView
|
||||
android:id="@+id/main"
|
||||
android:name="com.itsaky.androidide.fragments.MainFragment"
|
||||
<FrameLayout
|
||||
android:id="@+id/fragment_containers_parent"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/appbar" />
|
||||
app:layout_constraintTop_toBottomOf="@id/appbar">
|
||||
|
||||
<androidx.fragment.app.FragmentContainerView
|
||||
android:id="@+id/template_list"
|
||||
android:name="com.itsaky.androidide.fragments.TemplateListFragment"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/appbar" />
|
||||
<androidx.fragment.app.FragmentContainerView
|
||||
android:id="@+id/main"
|
||||
android:name="com.itsaky.androidide.fragments.MainFragment"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
|
||||
<androidx.fragment.app.FragmentContainerView
|
||||
android:id="@+id/template_details"
|
||||
android:name="com.itsaky.androidide.fragments.TemplateDetailsFragment"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/appbar" />
|
||||
<androidx.fragment.app.FragmentContainerView
|
||||
android:id="@+id/template_list"
|
||||
android:name="com.itsaky.androidide.fragments.TemplateListFragment"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
<androidx.fragment.app.FragmentContainerView
|
||||
android:id="@+id/template_details"
|
||||
android:name="com.itsaky.androidide.fragments.TemplateDetailsFragment"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
|
||||
</FrameLayout>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<androidx.coordinatorlayout.widget.CoordinatorLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
@@ -12,7 +13,8 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:elevation="8dp"
|
||||
app:elevation="8dp"
|
||||
app:layout_behavior="com.google.android.material.appbar.AppBarLayout$Behavior">
|
||||
app:layout_behavior="com.google.android.material.appbar.AppBarLayout$Behavior"
|
||||
android:fitsSystemWindows="true">
|
||||
|
||||
<com.google.android.material.appbar.MaterialToolbar
|
||||
android:id="@+id/toolbar"
|
||||
@@ -21,11 +23,28 @@
|
||||
|
||||
</com.google.android.material.appbar.AppBarLayout>
|
||||
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/fragmentContainer"
|
||||
<androidx.core.widget.NestedScrollView
|
||||
android:id="@+id/fragment_container_parent"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:layout_behavior="com.google.android.material.appbar.AppBarLayout$ScrollingViewBehavior" />
|
||||
app:layout_behavior="com.google.android.material.appbar.AppBarLayout$ScrollingViewBehavior">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/fragmentContainer"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
<com.itsaky.androidide.ui.BottomInsetHeightDistributor
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</androidx.core.widget.NestedScrollView>
|
||||
|
||||
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
||||
|
||||
@@ -1,16 +1,17 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/root"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
<LinearLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/root"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<com.itsaky.androidide.ui.virtualkeys.VirtualKeysView
|
||||
android:id="@+id/virtual_key_table"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="75dp"
|
||||
android:background="@android:color/black"
|
||||
tools:ignore="MissingClass" />
|
||||
<com.itsaky.androidide.ui.virtualkeys.VirtualKeysView
|
||||
android:id="@+id/virtual_key_table"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="75dp"
|
||||
android:background="@android:color/black"
|
||||
tools:ignore="MissingClass" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?><!--
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<!--
|
||||
~ This file is part of AndroidIDE.
|
||||
~
|
||||
~ AndroidIDE is free software: you can redistribute it and/or modify
|
||||
@@ -14,7 +16,9 @@
|
||||
~ You should have received a copy of the GNU General Public License
|
||||
~ along with AndroidIDE. If not, see <https://www.gnu.org/licenses/>.
|
||||
-->
|
||||
<com.itsaky.androidide.editor.ui.IDEEditor xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/editor"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
|
||||
<com.itsaky.androidide.editor.ui.IDEEditor
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/editor"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/coordinator"
|
||||
@@ -60,4 +61,4 @@
|
||||
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
|
||||
tools:listitem="@layout/layout_main_action_item" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?><!--
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<!--
|
||||
~ This file is part of AndroidIDE.
|
||||
~
|
||||
~ AndroidIDE is free software: you can redistribute it and/or modify
|
||||
@@ -15,7 +17,8 @@
|
||||
~ along with AndroidIDE. If not, see <https://www.gnu.org/licenses/>.
|
||||
-->
|
||||
|
||||
<com.itsaky.androidide.editor.ui.IDEEditor xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/editor"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
<com.itsaky.androidide.editor.ui.IDEEditor
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/editor"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?><!--
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<!--
|
||||
~ This file is part of AndroidIDE.
|
||||
~
|
||||
~ AndroidIDE is free software: you can redistribute it and/or modify
|
||||
@@ -15,7 +17,8 @@
|
||||
~ along with AndroidIDE. If not, see <https://www.gnu.org/licenses/>.
|
||||
-->
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
@@ -73,4 +76,4 @@
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?><!--
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<!--
|
||||
~ This file is part of AndroidIDE.
|
||||
~
|
||||
~ AndroidIDE is free software: you can redistribute it and/or modify
|
||||
@@ -15,7 +17,8 @@
|
||||
~ along with AndroidIDE. If not, see <https://www.gnu.org/licenses/>.
|
||||
-->
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
@@ -49,7 +52,7 @@
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/exit_button"
|
||||
style="@style/Widget.Material3.Button.TextButton"
|
||||
style="@style/Widget.Material3.Button.OutlinedButton"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="16dp"
|
||||
@@ -57,4 +60,4 @@
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?><!--
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<!--
|
||||
~ This file is part of AndroidIDE.
|
||||
~
|
||||
~ AndroidIDE is free software: you can redistribute it and/or modify
|
||||
@@ -15,7 +17,8 @@
|
||||
~ along with AndroidIDE. If not, see <https://www.gnu.org/licenses/>.
|
||||
-->
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
@@ -40,4 +43,4 @@
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<LinearLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/setup_wizard_layout"
|
||||
android:layout_width="match_parent"
|
||||
@@ -57,4 +58,4 @@
|
||||
android:id="@+id/footer_layout"
|
||||
layout="@layout/setup_footer" />
|
||||
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<LinearLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
@@ -137,4 +138,3 @@
|
||||
tools:text="AndroidIDE v2.1.3-beta for arm64-v8a" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/linearLayout3"
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?><!--
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<!--
|
||||
~ This file is part of AndroidIDE.
|
||||
~
|
||||
~ AndroidIDE is free software: you can redistribute it and/or modify
|
||||
@@ -15,7 +17,8 @@
|
||||
~ along with AndroidIDE. If not, see <https://www.gnu.org/licenses/>.
|
||||
-->
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
@@ -47,4 +50,4 @@
|
||||
app:layout_constraintTop_toBottomOf="@id/progress"
|
||||
tools:text="@string/msg_installing_apk" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?><!--
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<!--
|
||||
~ This file is part of AndroidIDE.
|
||||
~
|
||||
~ AndroidIDE is free software: you can redistribute it and/or modify
|
||||
@@ -14,7 +16,9 @@
|
||||
~ You should have received a copy of the GNU General Public License
|
||||
~ along with AndroidIDE. If not, see <https://www.gnu.org/licenses/>.
|
||||
-->
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<LinearLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
@@ -92,4 +93,3 @@
|
||||
android:visibility="gone" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<LinearLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
@@ -20,4 +21,3 @@
|
||||
tools:listitem="@layout/layout_diagnostic_item" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<TextView
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/msg"
|
||||
android:layout_width="wrap_content"
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<LinearLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
@@ -33,4 +34,3 @@
|
||||
tools:text="Diagnostic message" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?><!--
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<!--
|
||||
~ This file is part of AndroidIDE.
|
||||
~
|
||||
~ AndroidIDE is free software: you can redistribute it and/or modify
|
||||
@@ -14,7 +16,9 @@
|
||||
~ You should have received a copy of the GNU General Public License
|
||||
~ along with AndroidIDE. If not, see <https://www.gnu.org/licenses/>.
|
||||
-->
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
|
||||
<RelativeLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
@@ -110,5 +114,4 @@
|
||||
android:layout_marginBottom="16dp"
|
||||
android:src="@drawable/ic_share" />
|
||||
|
||||
|
||||
</RelativeLayout>
|
||||
</RelativeLayout>
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<RelativeLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:padding="16dp">
|
||||
@@ -17,4 +18,3 @@
|
||||
android:layout_centerInParent="true" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<LinearLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
@@ -46,4 +47,3 @@
|
||||
tools:text="@string/app_name" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
@@ -1,24 +1,26 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/loading_layout_root"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical"
|
||||
android:visibility="gone">
|
||||
<LinearLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/loading_layout_root"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical"
|
||||
android:visibility="gone">
|
||||
|
||||
<com.google.android.material.progressindicator.CircularProgressIndicator
|
||||
android:id="@+id/progressbar"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:indeterminate="true" />
|
||||
<com.google.android.material.progressindicator.CircularProgressIndicator
|
||||
android:id="@+id/progressbar"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:indeterminate="true" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/empty_label"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginTop="16dp"
|
||||
android:text="@string/wizard_loading"
|
||||
android:textSize="24sp" />
|
||||
</LinearLayout>
|
||||
<TextView
|
||||
android:id="@+id/empty_label"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginTop="16dp"
|
||||
android:text="@string/wizard_loading"
|
||||
android:textSize="24sp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?><!--
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<!--
|
||||
~ This file is part of AndroidIDE.
|
||||
~
|
||||
~ AndroidIDE is free software: you can redistribute it and/or modify
|
||||
@@ -15,7 +17,8 @@
|
||||
~ along with AndroidIDE. If not, see <https://www.gnu.org/licenses/>.
|
||||
-->
|
||||
|
||||
<com.google.android.material.button.MaterialButton xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<com.google.android.material.button.MaterialButton
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
style="@style/Widget.Material3.Button.TextButton.Icon"
|
||||
@@ -32,4 +35,4 @@
|
||||
app:iconPadding="8dp"
|
||||
app:iconTint="?attr/colorOnBackground"
|
||||
tools:icon="@drawable/ic_add"
|
||||
tools:text="@string/msg_create_new_project" />
|
||||
tools:text="@string/msg_create_new_project" />
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<RelativeLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
@@ -34,4 +35,3 @@
|
||||
tools:text="New file" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
@@ -48,4 +49,3 @@
|
||||
tools:text="@string/please_wait" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?><!--
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<!--
|
||||
~ This file is part of AndroidIDE.
|
||||
~
|
||||
~ AndroidIDE is free software: you can redistribute it and/or modify
|
||||
@@ -15,7 +17,8 @@
|
||||
~ along with AndroidIDE. If not, see <https://www.gnu.org/licenses/>.
|
||||
-->
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
@@ -42,4 +45,4 @@
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/icon" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?><!--
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<!--
|
||||
~ This file is part of AndroidIDE.
|
||||
~
|
||||
~ AndroidIDE is free software: you can redistribute it and/or modify
|
||||
@@ -15,7 +17,8 @@
|
||||
~ along with AndroidIDE. If not, see <https://www.gnu.org/licenses/>.
|
||||
-->
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
@@ -47,4 +50,4 @@
|
||||
tools:itemCount="3"
|
||||
tools:listitem="@layout/layout_run_task_item" />
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?><!--
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<!--
|
||||
~ This file is part of AndroidIDE.
|
||||
~
|
||||
~ AndroidIDE is free software: you can redistribute it and/or modify
|
||||
@@ -15,7 +17,8 @@
|
||||
~ along with AndroidIDE. If not, see <https://www.gnu.org/licenses/>.
|
||||
-->
|
||||
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<RelativeLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
@@ -82,4 +85,4 @@
|
||||
|
||||
</ViewFlipper>
|
||||
|
||||
</RelativeLayout>
|
||||
</RelativeLayout>
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?><!--
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<!--
|
||||
~ This file is part of AndroidIDE.
|
||||
~
|
||||
~ AndroidIDE is free software: you can redistribute it and/or modify
|
||||
@@ -15,7 +17,8 @@
|
||||
~ along with AndroidIDE. If not, see <https://www.gnu.org/licenses/>.
|
||||
-->
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
@@ -59,4 +62,4 @@
|
||||
app:layout_constraintTop_toBottomOf="@id/task_path"
|
||||
tools:text="Assemble main outputs for all the variants." />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?><!--
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<!--
|
||||
~ This file is part of AndroidIDE.
|
||||
~
|
||||
~ AndroidIDE is free software: you can redistribute it and/or modify
|
||||
@@ -15,7 +17,8 @@
|
||||
~ along with AndroidIDE. If not, see <https://www.gnu.org/licenses/>.
|
||||
-->
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
@@ -57,4 +60,4 @@
|
||||
app:layout_constraintTop_toBottomOf="@id/msg"
|
||||
app:strokeWidth="2dp" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.core.widget.NestedScrollView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<androidx.core.widget.NestedScrollView
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<RelativeLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
@@ -58,4 +59,3 @@
|
||||
</HorizontalScrollView>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<RelativeLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?><!--
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<!--
|
||||
~ This file is part of AndroidIDE.
|
||||
~
|
||||
~ AndroidIDE is free software: you can redistribute it and/or modify
|
||||
@@ -14,7 +16,9 @@
|
||||
~ You should have received a copy of the GNU General Public License
|
||||
~ along with AndroidIDE. If not, see <https://www.gnu.org/licenses/>.
|
||||
-->
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
|
||||
<LinearLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
@@ -51,4 +55,4 @@
|
||||
android:textAppearance="@style/TextAppearance.Material3.BodyMedium"
|
||||
tools:text="Button" />
|
||||
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Button xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<Button
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/symbol"
|
||||
style="@style/Widget.Material3.Button.TextButton"
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<com.google.android.material.card.MaterialCardView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="wrap_content"
|
||||
@@ -43,4 +44,4 @@
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?><!--
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<!--
|
||||
~ This file is part of AndroidIDE.
|
||||
~
|
||||
~ AndroidIDE is free software: you can redistribute it and/or modify
|
||||
@@ -15,11 +17,12 @@
|
||||
~ along with AndroidIDE. If not, see <https://www.gnu.org/licenses/>.
|
||||
-->
|
||||
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<LinearLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:orientation="vertical" />
|
||||
android:orientation="vertical" />
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<LinearLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
@@ -20,4 +21,3 @@
|
||||
app:thumbElevation="4dp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<LinearLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/footer"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
@@ -33,4 +34,5 @@
|
||||
android:paddingStart="16dp"
|
||||
android:paddingEnd="16dp"
|
||||
android:text="@string/next" />
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
@@ -162,4 +163,4 @@
|
||||
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<FrameLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
@@ -14,4 +15,4 @@
|
||||
tools:listitem="@layout/layout_template_list_item"
|
||||
tools:spanCount="3" />
|
||||
|
||||
</FrameLayout>
|
||||
</FrameLayout>
|
||||
|
||||
@@ -0,0 +1,63 @@
|
||||
/*
|
||||
* This file is part of AndroidIDE.
|
||||
*
|
||||
* AndroidIDE is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* AndroidIDE is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with AndroidIDE. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.itsaky.androidide.ui
|
||||
|
||||
import android.content.Context
|
||||
import android.util.AttributeSet
|
||||
import android.view.ViewGroup
|
||||
import android.widget.FrameLayout
|
||||
import androidx.core.view.doOnAttach
|
||||
import androidx.core.view.updateLayoutParams
|
||||
import com.itsaky.androidide.utils.getInsets
|
||||
|
||||
/**
|
||||
* This view will set its height to the value of a bottom screen inset as soon
|
||||
* as it is attached to a window. It is intended to be placed as the last view in a vertical
|
||||
* scrolling pane, so elements above it are always positioned above the navigation bar.
|
||||
*
|
||||
* The width of this view is defined manually
|
||||
*
|
||||
* @author Smooth E
|
||||
*/
|
||||
class BottomInsetHeightDistributor : FrameLayout {
|
||||
|
||||
constructor(context: Context) : super(context) {
|
||||
applyLayoutParameters()
|
||||
}
|
||||
|
||||
constructor(context: Context, attrs: AttributeSet?) : super(context, attrs) {
|
||||
applyLayoutParameters()
|
||||
}
|
||||
|
||||
constructor(
|
||||
context: Context,
|
||||
attrs: AttributeSet?,
|
||||
defStyleAttr: Int
|
||||
) : super(context, attrs, defStyleAttr) {
|
||||
applyLayoutParameters()
|
||||
}
|
||||
|
||||
private fun applyLayoutParameters() {
|
||||
doOnAttach { view ->
|
||||
updateLayoutParams<ViewGroup.LayoutParams> {
|
||||
height = getInsets(view).bottom
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
/*
|
||||
* This file is part of AndroidIDE.
|
||||
*
|
||||
* AndroidIDE is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* AndroidIDE is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with AndroidIDE. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.itsaky.androidide.utils
|
||||
|
||||
import android.graphics.Insets
|
||||
import android.graphics.Rect
|
||||
import android.os.Build
|
||||
import android.view.View
|
||||
import android.view.WindowInsets
|
||||
|
||||
/**
|
||||
* Acquires screen insets
|
||||
*
|
||||
* @param view Any View that is currently attached to a Window
|
||||
*
|
||||
* @return [Rect] containing acquired insets
|
||||
*
|
||||
* @author Smooth E
|
||||
*/
|
||||
fun getInsets(view: View): Rect {
|
||||
val insets: Rect
|
||||
val rootWindowInsets = view.rootWindowInsets
|
||||
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
|
||||
|
||||
val receivedInsets: Insets = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
|
||||
val typeMask = WindowInsets.Type.systemBars() or WindowInsets.Type.displayCutout()
|
||||
rootWindowInsets.getInsetsIgnoringVisibility(typeMask)
|
||||
} else {
|
||||
view.rootWindowInsets.stableInsets
|
||||
}
|
||||
|
||||
insets = Rect(
|
||||
receivedInsets.left,
|
||||
receivedInsets.top,
|
||||
receivedInsets.right,
|
||||
receivedInsets.bottom
|
||||
)
|
||||
} else {
|
||||
insets = Rect(
|
||||
rootWindowInsets.stableInsetLeft,
|
||||
rootWindowInsets.stableInsetTop,
|
||||
rootWindowInsets.stableInsetRight,
|
||||
rootWindowInsets.stableInsetBottom
|
||||
)
|
||||
}
|
||||
|
||||
return insets
|
||||
}
|
||||
@@ -1,4 +1,6 @@
|
||||
<resources><!--
|
||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<!--
|
||||
~ This file is part of AndroidIDE.
|
||||
~
|
||||
~ AndroidIDE is free software: you can redistribute it and/or modify
|
||||
@@ -48,7 +50,10 @@
|
||||
</style>
|
||||
|
||||
<style name="Theme.AndroidIDE" parent="Theme.AndroidIDE.Styled">
|
||||
<item name="android:statusBarColor">@android:color/transparent</item>
|
||||
<item name="android:navigationBarColor">@android:color/transparent</item>
|
||||
<item name="android:windowLightStatusBar">false</item>
|
||||
<item name="android:windowLightNavigationBar" tools:targetApi="27">false</item>
|
||||
</style>
|
||||
|
||||
<style name="AppTheme.Splash" parent="Theme.SplashScreen">
|
||||
@@ -57,4 +62,5 @@
|
||||
<item name="windowSplashScreenAnimationDuration">200</item>
|
||||
<item name="postSplashScreenTheme">@style/Theme.AndroidIDE</item>
|
||||
</style>
|
||||
|
||||
</resources>
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?><!--
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<!--
|
||||
~ This file is part of AndroidIDE.
|
||||
~
|
||||
~ AndroidIDE is free software: you can redistribute it and/or modify
|
||||
@@ -14,6 +16,7 @@
|
||||
~ You should have received a copy of the GNU General Public License
|
||||
~ along with AndroidIDE. If not, see <https://www.gnu.org/licenses/>.
|
||||
-->
|
||||
|
||||
<resources>
|
||||
<string-array name="dimension_units">
|
||||
<item>dp</item>
|
||||
@@ -23,4 +26,4 @@
|
||||
<item>in</item>
|
||||
<item>mm</item>
|
||||
</string-array>
|
||||
</resources>
|
||||
</resources>
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?><!--
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<!--
|
||||
~ This file is part of AndroidIDE.
|
||||
~
|
||||
~ AndroidIDE is free software: you can redistribute it and/or modify
|
||||
@@ -20,4 +22,4 @@
|
||||
<attr name="vector_src" format="reference" />
|
||||
<attr name="use_legacy_parser" format="boolean" />
|
||||
</declare-styleable>
|
||||
</resources>
|
||||
</resources>
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<resources>
|
||||
|
||||
<color name="light_colorPrimary">#ff6f5a4a</color>
|
||||
<color name="light_colorPrimaryContainer">#fff9ddc9</color>
|
||||
<color name="light_colorPrimaryDark">#fffffbff</color>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<color name="ic_launcher_background">@color/primaryColor</color>
|
||||
</resources>
|
||||
</resources>
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
<resources><!--
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<!--
|
||||
~ This file is part of AndroidIDE.
|
||||
~
|
||||
~ AndroidIDE is free software: you can redistribute it and/or modify
|
||||
@@ -15,6 +17,8 @@
|
||||
~ along with AndroidIDE. If not, see <https://www.gnu.org/licenses/>.
|
||||
-->
|
||||
|
||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<style name="Theme.AndroidIDE.Material" parent="Theme.Material3.Light.NoActionBar">
|
||||
<item name="colorPrimary">@color/light_colorPrimary</item>
|
||||
<item name="colorPrimaryContainer">@color/light_colorPrimaryContainer</item>
|
||||
@@ -50,6 +54,7 @@
|
||||
<item name="colorOnSurfaceVariant">@color/light_colorOnSurfaceVariant</item>
|
||||
|
||||
<item name="colorOutline">@color/light_colorOutline</item>
|
||||
|
||||
</style>
|
||||
|
||||
<style name="Theme.AndroidIDE.Base" parent="Theme.AndroidIDE.Material">
|
||||
@@ -68,7 +73,17 @@
|
||||
</style>
|
||||
|
||||
<style name="Theme.AndroidIDE" parent="Theme.AndroidIDE.Styled">
|
||||
<item name="android:statusBarColor">@android:color/transparent</item>
|
||||
<item name="android:navigationBarColor">@android:color/transparent</item>
|
||||
<item name="android:windowLightStatusBar">true</item>
|
||||
<item name="android:windowLightNavigationBar" tools:targetApi="27">true</item>
|
||||
</style>
|
||||
|
||||
<style
|
||||
name="TextAppearance.AndroidIDE.TitleLarge.Bold"
|
||||
parent="TextAppearance.Material3.TitleLarge">
|
||||
<item name="android:textStyle">bold</item>
|
||||
<item name="android:textAlignment">center</item>
|
||||
</style>
|
||||
|
||||
<style name="TextAppearance.AndroidIDE.BodySmall" parent="TextAppearance.Material3.BodySmall">
|
||||
@@ -137,4 +152,5 @@
|
||||
<item name="android:windowIsFloating">false</item>
|
||||
<item name="android:windowSoftInputMode">adjustResize</item>
|
||||
</style>
|
||||
|
||||
</resources>
|
||||
|
||||
Reference in New Issue
Block a user