1
0
mirror of https://github.com/KokaKiwi/BarInsta synced 2024-12-22 21:16:57 +00:00

Rename main activity to MainActivity

This commit is contained in:
Ammar Githam 2020-08-22 16:22:02 +09:00
parent edd95f6944
commit 0b183c5ab5
8 changed files with 440 additions and 443 deletions

View File

@ -45,7 +45,7 @@
<option name="STARTUP_CPU_PROFILING_CONFIGURATION_NAME" value="Sample Java Methods" />
</Profilers>
<option name="DEEP_LINK" value="" />
<option name="ACTIVITY_CLASS" value="awais.instagrabber.activities.Main" />
<option name="ACTIVITY_CLASS" value="awais.instagrabber.activities.MainActivity" />
<method v="2">
<option name="Android.Gradle.BeforeRunTask" enabled="true" />
</method>

View File

@ -19,7 +19,7 @@
tools:ignore="UnusedAttribute">
<activity
android:name=".activities.Main"
android:name=".activities.MainActivity"
android:launchMode="singleTop"
android:taskAffinity=".Main"
android:windowSoftInputMode="adjustResize">
@ -134,11 +134,11 @@
<activity
android:name=".activities.PostViewer"
android:parentActivityName=".activities.Main">
android:parentActivityName=".activities.MainActivity">
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value=".activities.Main" />
android:value=".activities.MainActivity" />
</activity>
<activity
@ -152,29 +152,29 @@
<activity
android:name=".activities.StoryViewer"
android:parentActivityName=".activities.Main">
android:parentActivityName=".activities.MainActivity">
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value=".activities.Main" />
android:value=".activities.MainActivity" />
</activity>
<activity
android:name=".activities.FollowViewer"
android:parentActivityName=".activities.Main">
android:parentActivityName=".activities.MainActivity">
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value=".activities.Main" />
android:value=".activities.MainActivity" />
</activity>
<activity
android:name=".activities.ProfilePicViewer"
android:parentActivityName=".activities.Main">
android:parentActivityName=".activities.MainActivity">
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value=".activities.Main" />
android:value=".activities.MainActivity" />
</activity>
<activity
@ -188,39 +188,39 @@
<activity
android:name=".activities.SavedViewer"
android:parentActivityName=".activities.Main">
android:parentActivityName=".activities.MainActivity">
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value=".activities.Main" />
android:value=".activities.MainActivity" />
</activity>
<activity
android:name=".activities.NotificationsViewer"
android:parentActivityName=".activities.Main">
android:parentActivityName=".activities.MainActivity">
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value=".activities.Main" />
android:value=".activities.MainActivity" />
</activity>
<activity
android:name=".activities.Login"
android:label="@string/login"
android:parentActivityName=".activities.Main">
android:parentActivityName=".activities.MainActivity">
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value=".activities.Main" />
android:value=".activities.MainActivity" />
</activity>
<activity
android:name=".activities.DirectMessagesActivity"
android:parentActivityName=".activities.Main">
android:parentActivityName=".activities.MainActivity">
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value=".activities.Main" />
android:value=".activities.MainActivity" />
</activity>
<provider

File diff suppressed because it is too large Load Diff

View File

@ -69,7 +69,7 @@ import static awais.instagrabber.utils.Utils.CHANNEL_ID;
import static awais.instagrabber.utils.Utils.notificationManager;
import static awais.instagrabber.utils.Utils.settingsHelper;
public final class Main extends BaseLanguageActivity {
public final class MainActivity extends BaseLanguageActivity {
private static final int INITIAL_DELAY_MILLIS = 200;
public static FetchListener<String> scanHack;
public static ItemGetter itemGetter;
@ -90,13 +90,13 @@ public final class Main extends BaseLanguageActivity {
new iStoryStatusFetcher(highlightModel.getId(), null, false, false,
(!mainHelper.isLoggedIn && Utils.settingsHelper.getBoolean(Constants.STORIESIG)), true, result -> {
if (result != null && result.length > 0)
startActivity(new Intent(Main.this, StoryViewer.class)
startActivity(new Intent(MainActivity.this, StoryViewer.class)
.putExtra(Constants.EXTRAS_USERNAME, userQuery.replace("@", ""))
.putExtra(Constants.EXTRAS_HIGHLIGHT, highlightModel.getTitle())
.putExtra(Constants.EXTRAS_STORIES, result)
);
else
Toast.makeText(Main.this, R.string.downloader_unknown_error, Toast.LENGTH_SHORT).show();
Toast.makeText(MainActivity.this, R.string.downloader_unknown_error, Toast.LENGTH_SHORT).show();
}).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
}
}
@ -264,7 +264,7 @@ public final class Main extends BaseLanguageActivity {
final GetActivityAsyncTask activityAsyncTask = new GetActivityAsyncTask(uid, cookie, result -> {
if (result == null) {
if (!Utils.isEmpty(cookie)) {
Toast.makeText(Main.this, R.string.downloader_unknown_error, Toast.LENGTH_SHORT).show();
Toast.makeText(MainActivity.this, R.string.downloader_unknown_error, Toast.LENGTH_SHORT).show();
}
return;
}
@ -293,7 +293,7 @@ public final class Main extends BaseLanguageActivity {
final String join = TextUtils.join(", ", list);
final String notificationString = getString(R.string.activity_count_prefix) + " " + join + ".";
final Intent intent = new Intent(getApplicationContext(), NotificationsViewer.class).setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
final Notification notification = new NotificationCompat.Builder(Main.this, CHANNEL_ID)
final Notification notification = new NotificationCompat.Builder(MainActivity.this, CHANNEL_ID)
.setCategory(NotificationCompat.CATEGORY_STATUS)
.setSmallIcon(R.drawable.ic_notif)
.setAutoCancel(true)

View File

@ -243,8 +243,7 @@ public final class PostViewer extends BaseLanguageActivity {
}
}
setupPostInfoBar("@"+viewerPostModel.getUsername(), viewerPostModel.getItemType(),
viewerPostModel.getLocation() == null ? null : viewerPostModel.getLocation());
setupPostInfoBar("@"+viewerPostModel.getUsername(), viewerPostModel.getItemType(), viewerPostModel.getLocation());
postCaption = postModel.getPostCaption();
viewerCaptionParent.setVisibility(View.VISIBLE);
@ -323,8 +322,8 @@ public final class PostViewer extends BaseLanguageActivity {
itemGetterItems = SavedViewer.itemGetter.get(itemGetType);
isMainSwipe = !(itemGetterItems.size() < 1 || itemGetType == ItemGetType.SAVED_ITEMS && isFromShare);
}
else if (itemGetType != null && Main.itemGetter != null) {
itemGetterItems = Main.itemGetter.get(itemGetType);
else if (itemGetType != null && MainActivity.itemGetter != null) {
itemGetterItems = MainActivity.itemGetter.get(itemGetType);
isMainSwipe = !(itemGetterItems.size() < 1 || itemGetType == ItemGetType.MAIN_ITEMS && isFromShare);
} else {
itemGetterItems = null;

View File

@ -6,7 +6,6 @@ import android.content.Context;
import android.content.DialogInterface;
import android.content.pm.PackageManager;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Toast;
@ -22,7 +21,7 @@ import com.google.android.material.bottomsheet.BottomSheetDialogFragment;
import java.util.ArrayList;
import awais.instagrabber.R;
import awais.instagrabber.activities.Main;
import awais.instagrabber.activities.MainActivity;
import awais.instagrabber.adapters.SimpleAdapter;
import awais.instagrabber.utils.Constants;
import awais.instagrabber.utils.DataBox;
@ -113,8 +112,8 @@ public final class QuickAccessDialog extends BottomSheetDialogFragment implement
else Utils.showImportExportDialog(v.getContext());
} else if (tag instanceof DataBox.FavoriteModel) {
if (Main.scanHack != null) {
Main.scanHack.onResult(((DataBox.FavoriteModel) tag).getQuery());
if (MainActivity.scanHack != null) {
MainActivity.scanHack.onResult(((DataBox.FavoriteModel) tag).getQuery());
dismiss();
}

View File

@ -70,7 +70,7 @@ import javax.crypto.spec.SecretKeySpec;
import awais.instagrabber.BuildConfig;
import awais.instagrabber.R;
import awais.instagrabber.activities.Main;
import awais.instagrabber.activities.MainActivity;
import awais.instagrabber.activities.ProfileViewer;
import awais.instagrabber.activities.SavedViewer;
import awais.instagrabber.asyncs.DownloadAsync;
@ -941,7 +941,7 @@ public final class Utils {
dir = new File(dir, username);
if (dir.exists() || dir.mkdirs()) {
final Main main = method != DownloadMethod.DOWNLOAD_FEED && context instanceof Main ? (Main) context : null;
final MainActivity mainActivity = method != DownloadMethod.DOWNLOAD_FEED && context instanceof MainActivity ? (MainActivity) context : null;
final ProfileViewer pv = method == DownloadMethod.DOWNLOAD_MAIN && context instanceof ProfileViewer ? (ProfileViewer) context : null;
final SavedViewer saved = method == DownloadMethod.DOWNLOAD_SAVED && context instanceof SavedViewer ? (SavedViewer) context : null;
@ -951,7 +951,7 @@ public final class Utils {
for (int i = itemsToDownloadSize - 1; i >= 0; i--) {
final BasePostModel selectedItem = itemsToDownload.get(i);
if (main == null && saved == null && pv == null) {
if (mainActivity == null && saved == null && pv == null) {
new DownloadAsync(context,
selectedItem.getDisplayUrl(),
getDownloadSaveFile(finalDir, selectedItem, ""),
@ -973,13 +973,13 @@ public final class Utils {
file -> {
model.setDownloaded(true);
if (saved != null) saved.deselectSelection(selectedItem);
else if (main != null) main.mainHelper.deselectSelection(selectedItem);
else if (mainActivity != null) mainActivity.mainHelper.deselectSelection(selectedItem);
else if (pv != null) pv.deselectSelection(selectedItem);
}).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
}
} else {
if (saved != null) saved.deselectSelection(selectedItem);
else if (main != null) main.mainHelper.deselectSelection(selectedItem);
else if (mainActivity != null) mainActivity.mainHelper.deselectSelection(selectedItem);
else if (pv != null) pv.deselectSelection(selectedItem);
}
}).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
@ -1014,7 +1014,7 @@ public final class Utils {
dir = new File(dir, username);
if (dir.exists() || dir.mkdirs()) {
final Main main = method != DownloadMethod.DOWNLOAD_FEED && context instanceof Main ? (Main) context : null;
final MainActivity mainActivity = method != DownloadMethod.DOWNLOAD_FEED && context instanceof MainActivity ? (MainActivity) context : null;
final int itemsToDownloadSize = itemsToDownload.size();
@ -1022,7 +1022,7 @@ public final class Utils {
for (int i = itemsToDownloadSize - 1; i >= 0; i--) {
final DirectItemMediaModel selectedItem = itemsToDownload.get(i);
if (main == null) {
if (mainActivity == null) {
new DownloadAsync(context,
selectedItem.getMediaType() == MediaItemType.MEDIA_TYPE_VIDEO ? selectedItem.getVideoUrl() : selectedItem.getThumbUrl(),
getDownloadSaveFileDm(finalDir, selectedItem, ""),

View File

@ -4,7 +4,7 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".activities.Main">
tools:context=".activities.MainActivity">
<LinearLayout
android:layout_width="match_parent"