refactor: move activities to 'activities' package

This commit is contained in:
Akash Yadav
2022-12-21 10:24:39 +05:30
parent d16c09fb18
commit dfe6dee0bb
26 changed files with 94 additions and 95 deletions
+6 -6
View File
@@ -26,7 +26,7 @@
android:theme="@style/Theme.AndroidIDE"
tools:ignore="UnusedAttribute,MediaCapabilities">
<activity
android:name=".CrashHandlerActivity"
android:name=".activities.CrashHandlerActivity"
android:exported="true"
android:windowSoftInputMode="stateAlwaysHidden">
<intent-filter>
@@ -35,7 +35,7 @@
</intent-filter>
</activity>
<activity
android:name=".MainActivity"
android:name=".activities.MainActivity"
android:configChanges="orientation|screenSize|uiMode"
android:exported="true"
android:theme="@style/AppTheme.Splash">
@@ -45,18 +45,18 @@
</intent-filter>
</activity>
<activity
android:name=".EditorActivityKt"
android:name=".activities.editor.EditorActivityKt"
android:launchMode="singleTop"
android:configChanges="orientation|screenSize|uiMode"
android:windowSoftInputMode="adjustResize" />
<activity
android:name=".PreferencesActivity"
android:name=".activities.PreferencesActivity"
android:configChanges="orientation|screenSize" />
<activity
android:name=".AboutActivity"
android:name=".activities.AboutActivity"
android:configChanges="orientation|screenSize|uiMode" />
<activity
android:name=".TerminalActivity"
android:name=".activities.TerminalActivity"
android:configChanges="orientation|screenSize|uiMode"
android:windowSoftInputMode="adjustResize" />
@@ -19,7 +19,7 @@ package com.itsaky.androidide.actions
import android.content.Context
import android.graphics.drawable.Drawable
import com.itsaky.androidide.EditorHandlerActivity
import com.itsaky.androidide.activities.editor.EditorHandlerActivity
/** @author Akash Yadav */
abstract class EditorActivityAction : ActionItem {
@@ -24,7 +24,7 @@ import androidx.core.content.ContextCompat
import com.android.aaptcompiler.AaptResourceType.LAYOUT
import com.android.aaptcompiler.extractPathData
import com.blankj.utilcode.util.KeyboardUtils
import com.itsaky.androidide.EditorHandlerActivity
import com.itsaky.androidide.activities.editor.EditorHandlerActivity
import com.itsaky.androidide.actions.ActionData
import com.itsaky.androidide.actions.EditorRelatedAction
import com.itsaky.androidide.editor.ui.IDEEditor
@@ -19,7 +19,7 @@ package com.itsaky.androidide.actions.file
import android.content.Context
import androidx.core.content.ContextCompat
import com.itsaky.androidide.EditorHandlerActivity
import com.itsaky.androidide.activities.editor.EditorHandlerActivity
import com.itsaky.androidide.R
import com.itsaky.androidide.actions.ActionData
@@ -19,7 +19,7 @@ package com.itsaky.androidide.actions.file
import android.content.Context
import androidx.core.content.ContextCompat
import com.itsaky.androidide.EditorHandlerActivity
import com.itsaky.androidide.activities.editor.EditorHandlerActivity
import com.itsaky.androidide.R
import com.itsaky.androidide.actions.ActionData
@@ -19,7 +19,7 @@ package com.itsaky.androidide.actions.file
import android.content.Context
import androidx.core.content.ContextCompat
import com.itsaky.androidide.EditorHandlerActivity
import com.itsaky.androidide.activities.editor.EditorHandlerActivity
import com.itsaky.androidide.R
import com.itsaky.androidide.actions.ActionData
@@ -17,7 +17,7 @@
package com.itsaky.androidide.actions.file
import com.itsaky.androidide.EditorHandlerActivity
import com.itsaky.androidide.activities.editor.EditorHandlerActivity
import com.itsaky.androidide.actions.ActionData
import com.itsaky.androidide.actions.ActionItem.Location
import com.itsaky.androidide.actions.ActionItem.Location.EDITOR_FILE_TABS
@@ -1,21 +1,20 @@
/*
* This file is part of AndroidIDE.
* 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 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/>.
* 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;
package com.itsaky.androidide.activities;
import android.content.Intent;
import android.os.Bundle;
@@ -25,6 +24,7 @@ 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;
@@ -15,7 +15,7 @@
* along with AndroidIDE. If not, see <https://www.gnu.org/licenses/>.
*/
package com.itsaky.androidide;
package com.itsaky.androidide.activities;
import android.os.Bundle;
import android.view.View;
@@ -1,23 +1,20 @@
/*
* This file is part of AndroidIDE.
* 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.
*
* 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/>.
*
* 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
package com.itsaky.androidide.activities
import android.R
import android.content.Intent
@@ -29,6 +26,7 @@ import android.widget.TextView
import androidx.core.splashscreen.SplashScreen.Companion.installSplashScreen
import androidx.core.text.HtmlCompat
import com.blankj.utilcode.util.SizeUtils
import com.itsaky.androidide.activities.editor.EditorActivityKt
import com.itsaky.androidide.R.id
import com.itsaky.androidide.app.IDEActivity
import com.itsaky.androidide.app.IDEApplication
@@ -1,30 +1,28 @@
/************************************************************************************
* This file is part of AndroidIDE.
/*
* 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.
*
* 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/>.
*
**************************************************************************************/
* 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;
package com.itsaky.androidide.activities;
import android.os.Bundle;
import android.view.View;
import androidx.fragment.app.Fragment;
import com.itsaky.androidide.R;
import com.itsaky.androidide.app.IDEActivity;
import com.itsaky.androidide.databinding.ActivityPreferencesBinding;
import com.itsaky.androidide.fragments.IDEPreferencesFragment;
@@ -1,21 +1,20 @@
/*
* This file is part of AndroidIDE.
* 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 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/>.
* 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;
package com.itsaky.androidide.activities;
import static com.itsaky.androidide.preferences.internal.GeneralPreferencesKt.getUseSystemShell;
import static com.itsaky.androidide.utils.Environment.BIN_DIR;
@@ -37,6 +36,7 @@ import androidx.annotation.NonNull;
import com.blankj.utilcode.util.ClipboardUtils;
import com.blankj.utilcode.util.KeyboardUtils;
import com.blankj.utilcode.util.ThrowableUtils;
import com.itsaky.androidide.R;
import com.itsaky.androidide.app.IDEActivity;
import com.itsaky.androidide.databinding.ActivityTerminalBinding;
import com.itsaky.androidide.fragments.CrashReportFragment;
@@ -15,7 +15,7 @@
* along with AndroidIDE. If not, see <https://www.gnu.org/licenses/>.
*/
package com.itsaky.androidide
package com.itsaky.androidide.activities.editor
import android.content.Intent
import android.content.IntentFilter
@@ -51,8 +51,11 @@ import com.google.android.material.tabs.TabLayout
import com.google.android.material.tabs.TabLayout.Tab
import com.itsaky.androidide.R.attr
import com.itsaky.androidide.R.drawable
import com.itsaky.androidide.R.id
import com.itsaky.androidide.R.string
import com.itsaky.androidide.actions.ActionItem.Location.EDITOR_FILE_TABS
import com.itsaky.androidide.activities.PreferencesActivity
import com.itsaky.androidide.activities.TerminalActivity
import com.itsaky.androidide.adapters.DiagnosticsAdapter
import com.itsaky.androidide.adapters.SearchListAdapter
import com.itsaky.androidide.app.IDEActivity
@@ -275,15 +278,15 @@ abstract class BaseEditorActivity :
override fun onNavigationItemSelected(item: MenuItem): Boolean {
when (item.itemId) {
R.id.editornav_discuss -> app.openTelegramGroup()
R.id.editornav_channel -> app.openTelegramChannel()
R.id.editornav_suggest -> app.openGitHub()
R.id.editornav_needHelp -> showNeedHelpDialog()
R.id.editornav_settings -> startActivity(Intent(this, PreferencesActivity::class.java))
R.id.editornav_share ->
id.editornav_discuss -> app.openTelegramGroup()
id.editornav_channel -> app.openTelegramChannel()
id.editornav_suggest -> app.openGitHub()
id.editornav_needHelp -> showNeedHelpDialog()
id.editornav_settings -> startActivity(Intent(this, PreferencesActivity::class.java))
id.editornav_share ->
startActivity(IntentUtils.getShareTextIntent(getString(string.msg_share_app)))
R.id.editornav_close_project -> doConfirmProjectClose()
R.id.editornav_terminal -> openTerminal()
id.editornav_close_project -> doConfirmProjectClose()
id.editornav_terminal -> openTerminal()
}
binding?.root?.closeDrawer(GravityCompat.START)
@@ -15,7 +15,7 @@
* along with AndroidIDE. If not, see <https://www.gnu.org/licenses/>.
*/
package com.itsaky.androidide
package com.itsaky.androidide.activities.editor
/**
* @author Akash Yadav
@@ -15,7 +15,7 @@
* along with AndroidIDE. If not, see <https://www.gnu.org/licenses/>.
*/
package com.itsaky.androidide
package com.itsaky.androidide.activities.editor
import android.annotation.SuppressLint
import android.content.Context
@@ -15,7 +15,7 @@
* along with AndroidIDE. If not, see <https://www.gnu.org/licenses/>.
*/
package com.itsaky.androidide
package com.itsaky.androidide.activities.editor
import android.content.ComponentName
import android.content.Intent
@@ -22,7 +22,7 @@ import android.net.Uri;
import com.blankj.utilcode.util.ThrowableUtils;
import com.itsaky.androidide.BuildConfig;
import com.itsaky.androidide.CrashHandlerActivity;
import com.itsaky.androidide.activities.CrashHandlerActivity;
import com.itsaky.androidide.events.AppEventsIndex;
import com.itsaky.androidide.events.LspApiEventsIndex;
import com.itsaky.androidide.events.LspJavaEventsIndex;
@@ -8,9 +8,9 @@ import android.view.ViewGroup
import android.widget.TextView
import com.blankj.utilcode.util.ThreadUtils
import com.google.android.material.progressindicator.LinearProgressIndicator
import com.itsaky.androidide.EditorActivityKt
import com.itsaky.androidide.PreferencesActivity
import com.itsaky.androidide.TerminalActivity
import com.itsaky.androidide.activities.editor.EditorActivityKt
import com.itsaky.androidide.activities.PreferencesActivity
import com.itsaky.androidide.activities.TerminalActivity
import com.itsaky.androidide.adapters.MainActionsListAdapter
import com.itsaky.androidide.app.BaseApplication
import com.itsaky.androidide.common.databinding.LayoutDialogProgressBinding
@@ -18,7 +18,7 @@
package com.itsaky.androidide.handlers
import android.content.Context
import com.itsaky.androidide.EditorHandlerActivity
import com.itsaky.androidide.activities.editor.EditorHandlerActivity
import com.itsaky.androidide.eventbus.events.Event
import com.itsaky.androidide.eventbus.events.EventReceiver
import com.itsaky.androidide.utils.ILogger
@@ -17,7 +17,7 @@
package com.itsaky.androidide.handlers
import com.itsaky.androidide.EditorHandlerActivity
import com.itsaky.androidide.activities.editor.EditorHandlerActivity
import com.itsaky.androidide.preferences.internal.isFirstBuild
import com.itsaky.androidide.resources.R.string
import com.itsaky.androidide.services.GradleBuildService
@@ -25,7 +25,7 @@ import androidx.core.view.GravityCompat
import com.blankj.utilcode.util.ClipboardUtils
import com.blankj.utilcode.util.FileIOUtils
import com.blankj.utilcode.util.FileUtils
import com.itsaky.androidide.EditorHandlerActivity
import com.itsaky.androidide.activities.editor.EditorHandlerActivity
import com.itsaky.androidide.adapters.viewholders.FileTreeViewHolder
import com.itsaky.androidide.databinding.LayoutCreateFileJavaBinding
import com.itsaky.androidide.eventbus.events.Event
@@ -27,7 +27,7 @@ import androidx.annotation.Nullable;
import com.blankj.utilcode.util.FileIOUtils;
import com.blankj.utilcode.util.FileUtils;
import com.itsaky.androidide.EditorHandlerActivity;
import com.itsaky.androidide.activities.editor.EditorHandlerActivity;
import com.itsaky.androidide.adapters.DiagnosticsAdapter;
import com.itsaky.androidide.adapters.SearchListAdapter;
import com.itsaky.androidide.fragments.sheets.ProgressSheet;
@@ -18,7 +18,7 @@
package com.itsaky.androidide.preferences
import android.content.Intent
import com.itsaky.androidide.AboutActivity
import com.itsaky.androidide.activities.AboutActivity
import com.itsaky.androidide.resources.R.string
import com.itsaky.androidide.app.BaseApplication
import com.itsaky.androidide.app.IDEApplication
@@ -19,6 +19,6 @@
android:id="@+id/root"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".CrashHandlerActivity">
tools:context=".activities.CrashHandlerActivity">
</androidx.constraintlayout.widget.ConstraintLayout>
@@ -19,7 +19,7 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".CrashHandlerActivity">
tools:context=".activities.CrashHandlerActivity">
<ImageButton
android:id="@+id/close_button"
@@ -74,7 +74,7 @@
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/completion_iconText"
app:layout_constraintTop_toBottomOf="@id/completion_label"
tools:text="com.itsaky.androidide.MainActivity" />
tools:text="com.itsaky.androidide.activities.MainActivity" />
<TextView