Preferences! Check description
1. Added preferences screens. 2. Some DM changes. 3. Init profile actions using servicesrenovate/org.robolectric-robolectric-4.x
-
4app/build.gradle
-
9app/src/main/java/awais/instagrabber/MainHelper.java
-
2app/src/main/java/awais/instagrabber/activities/BaseLanguageActivity.java
-
9app/src/main/java/awais/instagrabber/activities/Login.java
-
35app/src/main/java/awais/instagrabber/activities/MainActivity.java
-
9app/src/main/java/awais/instagrabber/activities/MainActivityBackup.java
-
4app/src/main/java/awais/instagrabber/adapters/DirectMessageInboxAdapter.java
-
31app/src/main/java/awais/instagrabber/adapters/viewholder/DirectMessageInboxItemViewHolder.java
-
14app/src/main/java/awais/instagrabber/asyncs/FeedFetcher.java
-
72app/src/main/java/awais/instagrabber/asyncs/direct_messages/InboxFetcher.java
-
45app/src/main/java/awais/instagrabber/dialogs/SettingsDialog.java
-
96app/src/main/java/awais/instagrabber/dialogs/TimeSettingsDialog.java
-
61app/src/main/java/awais/instagrabber/fragments/directmessages/DirectMessageThreadFragment.java
-
9app/src/main/java/awais/instagrabber/fragments/main/DiscoverFragment.java
-
10app/src/main/java/awais/instagrabber/fragments/main/FeedFragment.java
-
165app/src/main/java/awais/instagrabber/fragments/main/ProfileFragment.java
-
44app/src/main/java/awais/instagrabber/fragments/settings/BasePreferencesFragment.java
-
105app/src/main/java/awais/instagrabber/fragments/settings/MorePreferencesFragment.java
-
285app/src/main/java/awais/instagrabber/fragments/settings/SettingsPreferencesFragment.java
-
4app/src/main/java/awais/instagrabber/fragments/settings/helpers/AutoSummaryDropDownPreference.java
-
19app/src/main/java/awais/instagrabber/repositories/FriendshipRepository.java
-
4app/src/main/java/awais/instagrabber/repositories/ProfileRepository.java
-
76app/src/main/java/awais/instagrabber/repositories/responses/FriendshipRepositoryChangeResponseFriendshipStatus.java
-
27app/src/main/java/awais/instagrabber/repositories/responses/FriendshipRepositoryChangeResponseRootObject.java
-
2app/src/main/java/awais/instagrabber/services/BaseService.java
-
82app/src/main/java/awais/instagrabber/services/FriendshipService.java
-
35app/src/main/java/awais/instagrabber/services/ProfileService.java
-
1app/src/main/java/awais/instagrabber/utils/Constants.java
-
4app/src/main/java/awais/instagrabber/utils/ExportImportUtils.java
-
2app/src/main/java/awais/instagrabber/utils/LocaleUtils.java
-
21app/src/main/java/awais/instagrabber/utils/SettingsHelper.java
-
54app/src/main/java/awais/instagrabber/utils/Utils.java
-
BINapp/src/main/res/drawable-hdpi/ic_info.png
-
BINapp/src/main/res/drawable-hdpi/ic_like.png
-
BINapp/src/main/res/drawable-hdpi/ic_not_liked.png
-
BINapp/src/main/res/drawable-mdpi/ic_info.png
-
BINapp/src/main/res/drawable-mdpi/ic_like.png
-
BINapp/src/main/res/drawable-mdpi/ic_not_liked.png
-
BINapp/src/main/res/drawable-xhdpi/ic_info.png
-
BINapp/src/main/res/drawable-xhdpi/ic_like.png
-
BINapp/src/main/res/drawable-xhdpi/ic_not_liked.png
-
BINapp/src/main/res/drawable-xxhdpi/ic_info.png
-
BINapp/src/main/res/drawable-xxhdpi/ic_like.png
-
BINapp/src/main/res/drawable-xxhdpi/ic_not_liked.png
-
0app/src/main/res/drawable/ic_like.xml
-
0app/src/main/res/drawable/ic_not_liked.xml
-
5app/src/main/res/drawable/ic_outline_info_24.xml
-
10app/src/main/res/drawable/ic_outline_settings_24.xml
-
2app/src/main/res/layout/activity_direct_messages.xml
-
84app/src/main/res/layout/dialog_time_settings.xml
-
2app/src/main/res/layout/fragment_direct_messages_inbox.xml
-
2app/src/main/res/layout/item_comment.xml
-
10app/src/main/res/layout/layout_directory_chooser.xml
-
121app/src/main/res/layout/layout_dm_inbox_item.xml
-
138app/src/main/res/layout/layout_include_simple_item.xml
-
93app/src/main/res/layout/pref_custom_folder.xml
-
14app/src/main/res/layout/pref_more_header.xml
-
2app/src/main/res/menu/main_bottom_navigation_menu.xml
-
13app/src/main/res/navigation/direct_messages_nav_graph.xml
-
19app/src/main/res/navigation/more_nav_graph.xml
-
19app/src/main/res/values/arrays.xml
-
4app/src/main/res/values/dimens.xml
-
10app/src/main/res/values/strings.xml
@ -0,0 +1,44 @@ |
|||||
|
package awais.instagrabber.fragments.settings; |
||||
|
|
||||
|
import android.content.SharedPreferences; |
||||
|
import android.os.Bundle; |
||||
|
|
||||
|
import androidx.preference.PreferenceFragmentCompat; |
||||
|
import androidx.preference.PreferenceManager; |
||||
|
import androidx.preference.PreferenceScreen; |
||||
|
|
||||
|
import awais.instagrabber.activities.MainActivity; |
||||
|
import awais.instagrabber.utils.Constants; |
||||
|
import awais.instagrabber.utils.LocaleUtils; |
||||
|
|
||||
|
public abstract class BasePreferencesFragment extends PreferenceFragmentCompat implements SharedPreferences.OnSharedPreferenceChangeListener { |
||||
|
private boolean shouldRecreate = false; |
||||
|
|
||||
|
@Override |
||||
|
public void onCreatePreferences(final Bundle savedInstanceState, final String rootKey) { |
||||
|
final PreferenceManager preferenceManager = getPreferenceManager(); |
||||
|
preferenceManager.setSharedPreferencesName("settings"); |
||||
|
preferenceManager.getSharedPreferences().registerOnSharedPreferenceChangeListener(this); |
||||
|
final PreferenceScreen screen = preferenceManager.createPreferenceScreen(requireContext()); |
||||
|
setupPreferenceScreen(screen); |
||||
|
setPreferenceScreen(screen); |
||||
|
} |
||||
|
|
||||
|
abstract void setupPreferenceScreen(PreferenceScreen screen); |
||||
|
|
||||
|
protected void shouldRecreate() { |
||||
|
this.shouldRecreate = true; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public void onSharedPreferenceChanged(final SharedPreferences sharedPreferences, final String key) { |
||||
|
if (!shouldRecreate) return; |
||||
|
final MainActivity activity = (MainActivity) getActivity(); |
||||
|
if (activity == null) return; |
||||
|
if (key.equals(Constants.APP_LANGUAGE)) { |
||||
|
LocaleUtils.setLocale(activity.getBaseContext()); |
||||
|
} |
||||
|
shouldRecreate = false; |
||||
|
activity.recreate(); |
||||
|
} |
||||
|
} |
@ -0,0 +1,105 @@ |
|||||
|
package awais.instagrabber.fragments.settings; |
||||
|
|
||||
|
import android.content.Context; |
||||
|
import android.content.Intent; |
||||
|
import android.widget.Toast; |
||||
|
|
||||
|
import androidx.annotation.NonNull; |
||||
|
import androidx.annotation.Nullable; |
||||
|
import androidx.navigation.NavDirections; |
||||
|
import androidx.navigation.fragment.NavHostFragment; |
||||
|
import androidx.preference.Preference; |
||||
|
import androidx.preference.PreferenceCategory; |
||||
|
import androidx.preference.PreferenceScreen; |
||||
|
|
||||
|
import awais.instagrabber.R; |
||||
|
import awais.instagrabber.activities.Login; |
||||
|
import awais.instagrabber.utils.Constants; |
||||
|
import awais.instagrabber.utils.Utils; |
||||
|
|
||||
|
import static awais.instagrabber.utils.Utils.settingsHelper; |
||||
|
|
||||
|
public class MorePreferencesFragment extends BasePreferencesFragment { |
||||
|
private final String cookie = settingsHelper.getString(Constants.COOKIE); |
||||
|
|
||||
|
@Override |
||||
|
void setupPreferenceScreen(final PreferenceScreen screen) { |
||||
|
screen.addPreference(new MoreHeaderPreference(requireContext())); |
||||
|
|
||||
|
final PreferenceCategory accountCategory = new PreferenceCategory(requireContext()); |
||||
|
accountCategory.setTitle("Account"); |
||||
|
accountCategory.setIconSpaceReserved(false); |
||||
|
screen.addPreference(accountCategory); |
||||
|
final boolean isLoggedIn = !Utils.isEmpty(cookie) && Utils.getUserIdFromCookie(cookie) != null; |
||||
|
screen.addPreference(getPreference(isLoggedIn ? R.string.relogin : R.string.login, |
||||
|
isLoggedIn ? R.string.relogin_summary : -1, |
||||
|
-1, |
||||
|
preference -> { |
||||
|
startActivityForResult(new Intent(requireContext(), Login.class), Constants.LOGIN_RESULT_CODE); |
||||
|
return true; |
||||
|
})); |
||||
|
if (isLoggedIn) { |
||||
|
screen.addPreference(getPreference(R.string.logout, -1, preference -> { |
||||
|
Utils.setupCookies("LOGOUT"); |
||||
|
shouldRecreate(); |
||||
|
Toast.makeText(requireContext(), R.string.logout_success, Toast.LENGTH_SHORT).show(); |
||||
|
settingsHelper.putString(Constants.COOKIE, ""); |
||||
|
return true; |
||||
|
})); |
||||
|
} |
||||
|
|
||||
|
final PreferenceCategory defaultCategory = new PreferenceCategory(requireContext()); |
||||
|
screen.addPreference(defaultCategory); |
||||
|
defaultCategory.addPreference(getPreference(R.string.action_notif, R.drawable.ic_not_liked, preference -> false)); |
||||
|
defaultCategory.addPreference(getPreference(R.string.action_settings, R.drawable.ic_outline_settings_24, preference -> { |
||||
|
final NavDirections navDirections = MorePreferencesFragmentDirections.actionMorePreferencesFragmentToSettingsPreferencesFragment(); |
||||
|
NavHostFragment.findNavController(this).navigate(navDirections); |
||||
|
return true; |
||||
|
})); |
||||
|
defaultCategory.addPreference(getPreference(R.string.action_about, R.drawable.ic_outline_info_24, preference -> false)); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public void onActivityResult(final int requestCode, final int resultCode, @Nullable final Intent data) { |
||||
|
if (resultCode == Constants.LOGIN_RESULT_CODE) { |
||||
|
if (data == null) return; |
||||
|
final String cookie = data.getStringExtra("cookie"); |
||||
|
Utils.setupCookies(cookie); |
||||
|
shouldRecreate(); |
||||
|
Toast.makeText(requireContext(), R.string.login_success_loading_cookies, Toast.LENGTH_SHORT).show(); |
||||
|
settingsHelper.putString(Constants.COOKIE, cookie); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
@NonNull |
||||
|
private Preference getPreference(final int title, |
||||
|
final int icon, |
||||
|
final Preference.OnPreferenceClickListener clickListener) { |
||||
|
return getPreference(title, -1, icon, clickListener); |
||||
|
} |
||||
|
|
||||
|
@NonNull |
||||
|
private Preference getPreference(final int title, |
||||
|
final int summary, |
||||
|
final int icon, |
||||
|
final Preference.OnPreferenceClickListener clickListener) { |
||||
|
final Preference preference = new Preference(requireContext()); |
||||
|
if (icon <= 0) preference.setIconSpaceReserved(false); |
||||
|
if (icon > 0) preference.setIcon(icon); |
||||
|
preference.setTitle(title); |
||||
|
if (summary > 0) { |
||||
|
preference.setSummary(summary); |
||||
|
} |
||||
|
preference.setOnPreferenceClickListener(clickListener); |
||||
|
return preference; |
||||
|
} |
||||
|
|
||||
|
public static class MoreHeaderPreference extends Preference { |
||||
|
|
||||
|
public MoreHeaderPreference(final Context context) { |
||||
|
super(context); |
||||
|
setLayoutResource(R.layout.pref_more_header); |
||||
|
setSelectable(false); |
||||
|
} |
||||
|
} |
||||
|
} |
@ -0,0 +1,285 @@ |
|||||
|
package awais.instagrabber.fragments.settings; |
||||
|
|
||||
|
import android.content.Context; |
||||
|
import android.os.Bundle; |
||||
|
import android.view.Menu; |
||||
|
import android.view.MenuItem; |
||||
|
import android.view.View; |
||||
|
|
||||
|
import androidx.annotation.NonNull; |
||||
|
import androidx.annotation.Nullable; |
||||
|
import androidx.appcompat.widget.AppCompatButton; |
||||
|
import androidx.appcompat.widget.AppCompatTextView; |
||||
|
import androidx.preference.DropDownPreference; |
||||
|
import androidx.preference.ListPreference; |
||||
|
import androidx.preference.Preference; |
||||
|
import androidx.preference.PreferenceCategory; |
||||
|
import androidx.preference.PreferenceScreen; |
||||
|
import androidx.preference.PreferenceViewHolder; |
||||
|
import androidx.preference.SwitchPreferenceCompat; |
||||
|
|
||||
|
import com.google.android.material.switchmaterial.SwitchMaterial; |
||||
|
|
||||
|
import java.text.SimpleDateFormat; |
||||
|
|
||||
|
import awais.instagrabber.R; |
||||
|
import awais.instagrabber.dialogs.TimeSettingsDialog; |
||||
|
import awais.instagrabber.utils.Constants; |
||||
|
import awais.instagrabber.utils.DirectoryChooser; |
||||
|
import awais.instagrabber.utils.Utils; |
||||
|
|
||||
|
import static awais.instagrabber.utils.Constants.FOLDER_PATH; |
||||
|
import static awais.instagrabber.utils.Constants.FOLDER_SAVE_TO; |
||||
|
import static awais.instagrabber.utils.Utils.settingsHelper; |
||||
|
|
||||
|
public class SettingsPreferencesFragment extends BasePreferencesFragment { |
||||
|
private static final String TAG = "SettingsPrefsFrag"; |
||||
|
private static AppCompatTextView customPathTextView; |
||||
|
|
||||
|
@Override |
||||
|
public void onCreate(@Nullable final Bundle savedInstanceState) { |
||||
|
super.onCreate(savedInstanceState); |
||||
|
setHasOptionsMenu(true); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public void onPrepareOptionsMenu(@NonNull final Menu menu) { |
||||
|
super.onPrepareOptionsMenu(menu); |
||||
|
final MenuItem item = menu.findItem(R.id.favourites); |
||||
|
item.setVisible(false); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
void setupPreferenceScreen(final PreferenceScreen screen) { |
||||
|
screen.addPreference(getLanguagePreference()); |
||||
|
screen.addPreference(getThemePreference()); |
||||
|
screen.addPreference(getAmoledThemePreference()); |
||||
|
screen.addPreference(getDownloadUserFolderPreference()); |
||||
|
screen.addPreference(getSaveToCustomFolderPreference()); |
||||
|
screen.addPreference(getAutoPlayVideosPreference()); |
||||
|
screen.addPreference(getAlwaysMuteVideosPreference()); |
||||
|
screen.addPreference(getPostTimePreference()); |
||||
|
|
||||
|
final PreferenceCategory loggedInUsersPreferenceCategory = new PreferenceCategory(requireContext()); |
||||
|
loggedInUsersPreferenceCategory.setIconSpaceReserved(false); |
||||
|
screen.addPreference(loggedInUsersPreferenceCategory); |
||||
|
loggedInUsersPreferenceCategory.setTitle(R.string.login_settings); |
||||
|
loggedInUsersPreferenceCategory.addPreference(getMarkStoriesSeenPreference()); |
||||
|
loggedInUsersPreferenceCategory.addPreference(getEnableActivityNotificationsPreference()); |
||||
|
|
||||
|
final PreferenceCategory anonUsersPreferenceCategory = new PreferenceCategory(requireContext()); |
||||
|
anonUsersPreferenceCategory.setIconSpaceReserved(false); |
||||
|
screen.addPreference(anonUsersPreferenceCategory); |
||||
|
anonUsersPreferenceCategory.setTitle(R.string.anonymous_settings); |
||||
|
anonUsersPreferenceCategory.addPreference(getUseInstaDpPreference()); |
||||
|
anonUsersPreferenceCategory.addPreference(getUseStoriesIgPreference()); |
||||
|
|
||||
|
} |
||||
|
|
||||
|
@NonNull |
||||
|
private DropDownPreference getLanguagePreference() { |
||||
|
final DropDownPreference preference = new DropDownPreference(requireContext()); |
||||
|
preference.setSummaryProvider(ListPreference.SimpleSummaryProvider.getInstance()); |
||||
|
final int length = getResources().getStringArray(R.array.languages).length; |
||||
|
final String[] values = new String[length]; |
||||
|
for (int i = 0; i < length; i++) { |
||||
|
values[i] = String.valueOf(i); |
||||
|
} |
||||
|
preference.setKey(Constants.APP_LANGUAGE); |
||||
|
preference.setTitle(R.string.select_language); |
||||
|
preference.setEntries(R.array.languages); |
||||
|
preference.setIconSpaceReserved(false); |
||||
|
preference.setEntryValues(values); |
||||
|
preference.setOnPreferenceChangeListener((preference1, newValue) -> { |
||||
|
shouldRecreate(); |
||||
|
return true; |
||||
|
}); |
||||
|
return preference; |
||||
|
} |
||||
|
|
||||
|
@NonNull |
||||
|
private DropDownPreference getThemePreference() { |
||||
|
final DropDownPreference preference = new DropDownPreference(requireContext()); |
||||
|
preference.setSummaryProvider(ListPreference.SimpleSummaryProvider.getInstance()); |
||||
|
final int length = getResources().getStringArray(R.array.theme_presets).length; |
||||
|
final String[] values = new String[length]; |
||||
|
for (int i = 0; i < length; i++) { |
||||
|
values[i] = String.valueOf(i); |
||||
|
} |
||||
|
preference.setKey(Constants.APP_THEME); |
||||
|
preference.setTitle(R.string.theme_settings); |
||||
|
preference.setEntries(R.array.theme_presets); |
||||
|
preference.setIconSpaceReserved(false); |
||||
|
preference.setEntryValues(values); |
||||
|
preference.setOnPreferenceChangeListener((preference1, newValue) -> { |
||||
|
shouldRecreate(); |
||||
|
return true; |
||||
|
}); |
||||
|
return preference; |
||||
|
} |
||||
|
|
||||
|
private SwitchPreferenceCompat getAmoledThemePreference() { |
||||
|
final SwitchPreferenceCompat preference = new SwitchPreferenceCompat(requireContext()); |
||||
|
preference.setKey(Constants.AMOLED_THEME); |
||||
|
preference.setTitle(R.string.use_amoled_dark_theme); |
||||
|
preference.setIconSpaceReserved(false); |
||||
|
preference.setOnPreferenceChangeListener((preference1, newValue) -> { |
||||
|
final boolean isNight = Utils.isNight(requireContext(), settingsHelper.getThemeCode(true)); |
||||
|
if (isNight) shouldRecreate(); |
||||
|
return true; |
||||
|
}); |
||||
|
return preference; |
||||
|
} |
||||
|
|
||||
|
private Preference getDownloadUserFolderPreference() { |
||||
|
final SwitchPreferenceCompat preference = new SwitchPreferenceCompat(requireContext()); |
||||
|
preference.setKey(Constants.DOWNLOAD_USER_FOLDER); |
||||
|
preference.setTitle("Download to username folder"); |
||||
|
preference.setSummary(R.string.download_user_folder); |
||||
|
preference.setIconSpaceReserved(false); |
||||
|
return preference; |
||||
|
} |
||||
|
|
||||
|
private Preference getSaveToCustomFolderPreference() { |
||||
|
return new SaveToCustomFolderPreference(requireContext(), (resultCallback) -> { |
||||
|
new DirectoryChooser() |
||||
|
.setInitialDirectory(settingsHelper.getString(FOLDER_PATH)) |
||||
|
.setInteractionListener(path -> { |
||||
|
settingsHelper.putString(FOLDER_PATH, path); |
||||
|
resultCallback.onResult(path); |
||||
|
}) |
||||
|
.show(getParentFragmentManager(), null); |
||||
|
}); |
||||
|
} |
||||
|
|
||||
|
private Preference getAutoPlayVideosPreference() { |
||||
|
final SwitchPreferenceCompat preference = new SwitchPreferenceCompat(requireContext()); |
||||
|
preference.setKey(Constants.AUTOPLAY_VIDEOS); |
||||
|
preference.setTitle(R.string.post_viewer_autoplay_video); |
||||
|
preference.setIconSpaceReserved(false); |
||||
|
return preference; |
||||
|
} |
||||
|
|
||||
|
private Preference getAlwaysMuteVideosPreference() { |
||||
|
final SwitchPreferenceCompat preference = new SwitchPreferenceCompat(requireContext()); |
||||
|
preference.setKey(Constants.MUTED_VIDEOS); |
||||
|
preference.setTitle(R.string.post_viewer_muted_autoplay); |
||||
|
preference.setIconSpaceReserved(false); |
||||
|
return preference; |
||||
|
} |
||||
|
|
||||
|
private Preference getMarkStoriesSeenPreference() { |
||||
|
final SwitchPreferenceCompat preference = new SwitchPreferenceCompat(requireContext()); |
||||
|
preference.setKey(Constants.MARK_AS_SEEN); |
||||
|
preference.setTitle(R.string.mark_as_seen_setting); |
||||
|
preference.setSummary(R.string.mark_as_seen_setting_summary); |
||||
|
preference.setIconSpaceReserved(false); |
||||
|
return preference; |
||||
|
} |
||||
|
|
||||
|
private Preference getEnableActivityNotificationsPreference() { |
||||
|
final SwitchPreferenceCompat preference = new SwitchPreferenceCompat(requireContext()); |
||||
|
preference.setKey(Constants.CHECK_ACTIVITY); |
||||
|
preference.setTitle(R.string.activity_setting); |
||||
|
preference.setIconSpaceReserved(false); |
||||
|
return preference; |
||||
|
} |
||||
|
|
||||
|
private Preference getUseInstaDpPreference() { |
||||
|
final SwitchPreferenceCompat preference = new SwitchPreferenceCompat(requireContext()); |
||||
|
preference.setKey(Constants.INSTADP); |
||||
|
preference.setTitle(R.string.instadp_settings); |
||||
|
preference.setIconSpaceReserved(false); |
||||
|
return preference; |
||||
|
} |
||||
|
|
||||
|
private Preference getUseStoriesIgPreference() { |
||||
|
final SwitchPreferenceCompat preference = new SwitchPreferenceCompat(requireContext()); |
||||
|
preference.setKey(Constants.STORIESIG); |
||||
|
preference.setTitle(R.string.storiesig_settings); |
||||
|
preference.setIconSpaceReserved(false); |
||||
|
return preference; |
||||
|
} |
||||
|
|
||||
|
private Preference getPostTimePreference() { |
||||
|
final Preference preference = new Preference(requireContext()); |
||||
|
preference.setTitle(R.string.time_settings); |
||||
|
preference.setIconSpaceReserved(false); |
||||
|
preference.setOnPreferenceClickListener(preference1 -> { |
||||
|
new TimeSettingsDialog(settingsHelper.getBoolean(Constants.CUSTOM_DATE_TIME_FORMAT_ENABLED), |
||||
|
settingsHelper.getString(Constants.CUSTOM_DATE_TIME_FORMAT), |
||||
|
settingsHelper.getString(Constants.DATE_TIME_SELECTION), |
||||
|
(isCustomFormat, |
||||
|
formatSelection, |
||||
|
spTimeFormatSelectedItemPosition, |
||||
|
spSeparatorSelectedItemPosition, |
||||
|
spDateFormatSelectedItemPosition, |
||||
|
selectedFormat, currentFormat) -> { |
||||
|
if (isCustomFormat) { |
||||
|
settingsHelper.putString(Constants.CUSTOM_DATE_TIME_FORMAT, formatSelection); |
||||
|
} else { |
||||
|
final String formatSelectionUpdated = spTimeFormatSelectedItemPosition + ";" |
||||
|
+ spSeparatorSelectedItemPosition + ';' |
||||
|
+ spDateFormatSelectedItemPosition; // time;separator;date |
||||
|
settingsHelper.putString(Constants.DATE_TIME_FORMAT, selectedFormat); |
||||
|
settingsHelper.putString(Constants.DATE_TIME_SELECTION, formatSelectionUpdated); |
||||
|
} |
||||
|
settingsHelper.putBoolean(Constants.CUSTOM_DATE_TIME_FORMAT_ENABLED, isCustomFormat); |
||||
|
Utils.datetimeParser = (SimpleDateFormat) currentFormat.clone(); |
||||
|
} |
||||
|
).show(getParentFragmentManager(), null); |
||||
|
return true; |
||||
|
}); |
||||
|
return preference; |
||||
|
} |
||||
|
|
||||
|
public static class SaveToCustomFolderPreference extends Preference { |
||||
|
|
||||
|
private final OnSelectFolderButtonClickListener onSelectFolderButtonClickListener; |
||||
|
private String key; |
||||
|
|
||||
|
public SaveToCustomFolderPreference(final Context context, final OnSelectFolderButtonClickListener onSelectFolderButtonClickListener) { |
||||
|
super(context); |
||||
|
this.onSelectFolderButtonClickListener = onSelectFolderButtonClickListener; |
||||
|
key = Constants.FOLDER_SAVE_TO; |
||||
|
setLayoutResource(R.layout.pref_custom_folder); |
||||
|
setKey(key); |
||||
|
setTitle(R.string.save_to_folder); |
||||
|
setIconSpaceReserved(false); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public void onBindViewHolder(final PreferenceViewHolder holder) { |
||||
|
super.onBindViewHolder(holder); |
||||
|
final SwitchMaterial cbSaveTo = (SwitchMaterial) holder.findViewById(R.id.cbSaveTo); |
||||
|
final View buttonContainer = holder.findViewById(R.id.button_container); |
||||
|
customPathTextView = (AppCompatTextView) holder.findViewById(R.id.custom_path); |
||||
|
cbSaveTo.setOnCheckedChangeListener((buttonView, isChecked) -> { |
||||
|
settingsHelper.putBoolean(FOLDER_SAVE_TO, isChecked); |
||||
|
buttonContainer.setVisibility(isChecked ? View.VISIBLE : View.GONE); |
||||
|
final String customPath = settingsHelper.getString(FOLDER_PATH); |
||||
|
customPathTextView.setText(customPath); |
||||
|
}); |
||||
|
final boolean savedToEnabled = settingsHelper.getBoolean(key); |
||||
|
holder.itemView.setOnClickListener(v -> cbSaveTo.toggle()); |
||||
|
cbSaveTo.setChecked(savedToEnabled); |
||||
|
buttonContainer.setVisibility(savedToEnabled ? View.VISIBLE : View.GONE); |
||||
|
final AppCompatButton btnSaveTo = (AppCompatButton) holder.findViewById(R.id.btnSaveTo); |
||||
|
btnSaveTo.setOnClickListener(v -> { |
||||
|
if (onSelectFolderButtonClickListener == null) return; |
||||
|
onSelectFolderButtonClickListener.onClick(result -> { |
||||
|
if (Utils.isEmpty(result)) return; |
||||
|
customPathTextView.setText(result); |
||||
|
}); |
||||
|
}); |
||||
|
} |
||||
|
|
||||
|
public interface ResultCallback { |
||||
|
void onResult(String result); |
||||
|
} |
||||
|
|
||||
|
public interface OnSelectFolderButtonClickListener { |
||||
|
void onClick(ResultCallback resultCallback); |
||||
|
} |
||||
|
} |
||||
|
} |
@ -0,0 +1,4 @@ |
|||||
|
package awais.instagrabber.fragments.settings.helpers; |
||||
|
|
||||
|
public class AutoSummaryDropDownPreference { |
||||
|
} |
@ -0,0 +1,19 @@ |
|||||
|
package awais.instagrabber.repositories; |
||||
|
|
||||
|
import java.util.Map; |
||||
|
|
||||
|
import awais.instagrabber.repositories.responses.FriendshipRepositoryChangeResponseRootObject; |
||||
|
import retrofit2.Call; |
||||
|
import retrofit2.http.FieldMap; |
||||
|
import retrofit2.http.FormUrlEncoded; |
||||
|
import retrofit2.http.POST; |
||||
|
import retrofit2.http.Path; |
||||
|
|
||||
|
public interface FriendshipRepository { |
||||
|
|
||||
|
@FormUrlEncoded |
||||
|
@POST("/api/v1/friendships/{action}/{id}/") |
||||
|
Call<FriendshipRepositoryChangeResponseRootObject> change(@Path("action") String action, |
||||
|
@Path("id") String id, |
||||
|
@FieldMap Map<String, String> form); |
||||
|
} |
@ -1,4 +0,0 @@ |
|||||
package awais.instagrabber.repositories; |
|
||||
|
|
||||
public interface ProfileRepository { |
|
||||
} |
|
@ -0,0 +1,76 @@ |
|||||
|
package awais.instagrabber.repositories.responses; |
||||
|
|
||||
|
public class FriendshipRepositoryChangeResponseFriendshipStatus { |
||||
|
private boolean following; |
||||
|
private boolean followedBy; |
||||
|
private boolean blocking; |
||||
|
private boolean muting; |
||||
|
private boolean isPrivate; |
||||
|
private boolean incomingRequest; |
||||
|
private boolean outgoingRequest; |
||||
|
private boolean isBestie; |
||||
|
|
||||
|
public FriendshipRepositoryChangeResponseFriendshipStatus(final boolean following, |
||||
|
final boolean followedBy, |
||||
|
final boolean blocking, |
||||
|
final boolean muting, |
||||
|
final boolean isPrivate, |
||||
|
final boolean incomingRequest, |
||||
|
final boolean outgoingRequest, |
||||
|
final boolean isBestie) { |
||||
|
this.following = following; |
||||
|
this.followedBy = followedBy; |
||||
|
this.blocking = blocking; |
||||
|
this.muting = muting; |
||||
|
this.isPrivate = isPrivate; |
||||
|
this.incomingRequest = incomingRequest; |
||||
|
this.outgoingRequest = outgoingRequest; |
||||
|
this.isBestie = isBestie; |
||||
|
} |
||||
|
|
||||
|
public boolean isFollowing() { |
||||
|
return following; |
||||
|
} |
||||
|
|
||||
|
public boolean isFollowedBy() { |
||||
|
return followedBy; |
||||
|
} |
||||
|
|
||||
|
public boolean isBlocking() { |
||||
|
return blocking; |
||||
|
} |
||||
|
|
||||
|
public boolean isMuting() { |
||||
|
return muting; |
||||
|
} |
||||
|
|
||||
|
public boolean isPrivate() { |
||||
|
return isPrivate; |
||||
|
} |
||||
|
|
||||
|
public boolean isIncomingRequest() { |
||||
|
return incomingRequest; |
||||
|
} |
||||
|
|
||||
|
public boolean isOutgoingRequest() { |
||||
|
return outgoingRequest; |
||||
|
} |
||||
|
|
||||
|
public boolean isBestie() { |
||||
|
return isBestie; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public String toString() { |
||||
|
return "FriendshipRepositoryChangeResponseFriendshipStatus{" + |
||||
|
"following=" + following + |
||||
|
", followedBy=" + followedBy + |
||||
|
", blocking=" + blocking + |
||||
|
", muting=" + muting + |
||||
|
", isPrivate=" + isPrivate + |
||||
|
", incomingRequest=" + incomingRequest + |
||||
|
", outgoingRequest=" + outgoingRequest + |
||||
|
", isBestie=" + isBestie + |
||||
|
'}'; |
||||
|
} |
||||
|
} |
@ -0,0 +1,27 @@ |
|||||
|
package awais.instagrabber.repositories.responses; |
||||
|
|
||||
|
public class FriendshipRepositoryChangeResponseRootObject { |
||||
|
private FriendshipRepositoryChangeResponseFriendshipStatus friendshipStatus; |
||||
|
private String status; |
||||
|
|
||||
|
public FriendshipRepositoryChangeResponseRootObject(final FriendshipRepositoryChangeResponseFriendshipStatus friendshipStatus, final String status) { |
||||
|
this.friendshipStatus = friendshipStatus; |
||||
|
this.status = status; |
||||
|
} |
||||
|
|
||||
|
public FriendshipRepositoryChangeResponseFriendshipStatus getFriendshipStatus() { |
||||
|
return friendshipStatus; |
||||
|
} |
||||
|
|
||||
|
public String getStatus() { |
||||
|
return status; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public String toString() { |
||||
|
return "FriendshipRepositoryChangeResponseRootObject{" + |
||||
|
"friendshipStatus=" + friendshipStatus + |
||||
|
", status='" + status + '\'' + |
||||
|
'}'; |
||||
|
} |
||||
|
} |
@ -0,0 +1,82 @@ |
|||||
|
package awais.instagrabber.services; |
||||
|
|
||||
|
import androidx.annotation.NonNull; |
||||
|
|
||||
|
import java.util.HashMap; |
||||
|
import java.util.Map; |
||||
|
import java.util.UUID; |
||||
|
|
||||
|
import awais.instagrabber.repositories.FriendshipRepository; |
||||
|
import awais.instagrabber.repositories.responses.FriendshipRepositoryChangeResponseRootObject; |
||||
|
import awais.instagrabber.utils.Utils; |
||||
|
import retrofit2.Call; |
||||
|
import retrofit2.Callback; |
||||
|
import retrofit2.Response; |
||||
|
import retrofit2.Retrofit; |
||||
|
|
||||
|
public class FriendshipService extends BaseService { |
||||
|
private static final String TAG = "ProfileService"; |
||||
|
|
||||
|
private final FriendshipRepository repository; |
||||
|
|
||||
|
private static FriendshipService instance; |
||||
|
|
||||
|
private FriendshipService() { |
||||
|
final Retrofit retrofit = getRetrofitBuilder() |
||||
|
.baseUrl("https://i.instagram.com") |
||||
|
.build(); |
||||
|
repository = retrofit.create(FriendshipRepository.class); |
||||
|
} |
||||
|
|
||||
|
public static FriendshipService getInstance() { |
||||
|
if (instance == null) { |
||||
|
instance = new FriendshipService(); |
||||
|
} |
||||
|
return instance; |
||||
|
} |
||||
|
|
||||
|
public void follow(final String userId, |
||||
|
final String targetUserId, |
||||
|
final String crsfToken, |
||||
|
final ServiceCallback<FriendshipRepositoryChangeResponseRootObject> callback) { |
||||
|
change("create", userId, targetUserId, crsfToken, callback); |
||||
|
} |
||||
|
|
||||
|
public void unfollow(final String userId, |
||||
|
final String targetUserId, |
||||
|
final String crsfToken, |
||||
|
final ServiceCallback<FriendshipRepositoryChangeResponseRootObject> callback) { |
||||
|
change("destroy", userId, targetUserId, crsfToken, callback); |
||||
|
} |
||||
|
|
||||
|
private void change(final String action, |
||||
|
final String userId, |
||||
|
final String targetUserId, |
||||
|
final String crsfToken, |
||||
|
final ServiceCallback<FriendshipRepositoryChangeResponseRootObject> callback) { |
||||
|
final Map<String, Object> form = new HashMap<>(5); |
||||
|
form.put("_csrftoken", crsfToken); |
||||
|
form.put("_uid", userId); |
||||
|
form.put("_uuid", UUID.randomUUID().toString()); |
||||
|
form.put("user_id", targetUserId); |
||||
|
final Map<String, String> signedForm = Utils.sign(form); |
||||
|
final Call<FriendshipRepositoryChangeResponseRootObject> request = repository.change(action, targetUserId, signedForm); |
||||
|
request.enqueue(new Callback<FriendshipRepositoryChangeResponseRootObject>() { |
||||
|
@Override |
||||
|
public void onResponse(@NonNull final Call<FriendshipRepositoryChangeResponseRootObject> call, |
||||
|
@NonNull final Response<FriendshipRepositoryChangeResponseRootObject> response) { |
||||
|
if (callback != null) { |
||||
|
callback.onSuccess(response.body()); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public void onFailure(@NonNull final Call<FriendshipRepositoryChangeResponseRootObject> call, |
||||
|
@NonNull final Throwable t) { |
||||
|
if (callback != null) { |
||||
|
callback.onFailure(t); |
||||
|
} |
||||
|
} |
||||
|
}); |
||||
|
} |
||||
|
} |
@ -1,35 +0,0 @@ |
|||||
package awais.instagrabber.services; |
|
||||
|
|
||||
import awais.instagrabber.repositories.ProfileRepository; |
|
||||
import retrofit2.Retrofit; |
|
||||
|
|
||||
public class ProfileService extends BaseService { |
|
||||
private static final String TAG = "ProfileService"; |
|
||||
|
|
||||
private final ProfileRepository repository; |
|
||||
|
|
||||
private static ProfileService instance; |
|
||||
|
|
||||
private ProfileService() { |
|
||||
final Retrofit retrofit = getRetrofitBuilder() |
|
||||
.baseUrl("https://i.instagram.com") |
|
||||
.build(); |
|
||||
repository = retrofit.create(ProfileRepository.class); |
|
||||
} |
|
||||
|
|
||||
public static ProfileService getInstance() { |
|
||||
if (instance == null) { |
|
||||
instance = new ProfileService(); |
|
||||
} |
|
||||
return instance; |
|
||||
} |
|
||||
|
|
||||
public void followProfile(final String username) { |
|
||||
// final String url = "https://www.instagram.com/web/" + (action.equals("followtag") && mainActivity.hashtagModel != null ? "tags/" + (mainActivity.hashtagModel.getFollowing() ? "unfollow/" : "follow/") + mainActivity.hashtagModel.getName() + "/" : (action.equals("restrict") && mainActivity.profileModel != null ? "restrict_action" : "friendships/" + mainActivity.profileModel.getId()) + "/" + (action.equals("follow") ? |
|
||||
// mainActivity.profileModel.getFollowing() || mainActivity.profileModel.getRequested() |
|
||||
// ? "unfollow/" : "follow/" : |
|
||||
// action.equals("restrict") ? |
|
||||
// mainActivity.profileModel.getRestricted() ? "unrestrict/" : "restrict/" : |
|
||||
// mainActivity.profileModel.getBlocked() ? "unblock/" : "block/")); |
|
||||
} |
|
||||
} |
|
Before Width: 36 | Height: 36 | Size: 451 B |
Before Width: 36 | Height: 36 | Size: 333 B |
Before Width: 36 | Height: 36 | Size: 435 B |
Before Width: 24 | Height: 24 | Size: 253 B |
Before Width: 24 | Height: 24 | Size: 239 B |
Before Width: 24 | Height: 24 | Size: 311 B |
Before Width: 48 | Height: 48 | Size: 597 B |
Before Width: 48 | Height: 48 | Size: 415 B |
Before Width: 48 | Height: 48 | Size: 560 B |
Before Width: 72 | Height: 72 | Size: 811 B |
Before Width: 72 | Height: 72 | Size: 570 B |
Before Width: 72 | Height: 72 | Size: 815 B |
@ -1,10 +1,9 @@ |
|||||
<vector xmlns:android="http://schemas.android.com/apk/res/android" |
<vector xmlns:android="http://schemas.android.com/apk/res/android" |
||||
android:width="24dp" |
android:width="24dp" |
||||
android:height="24dp" |
android:height="24dp" |
||||
android:alpha="0.8" |
|
||||
android:tint="?attr/colorControlNormal" |
|
||||
android:viewportWidth="24" |
android:viewportWidth="24" |
||||
android:viewportHeight="24"> |
|
||||
|
android:viewportHeight="24" |
||||
|
android:tint="?attr/colorControlNormal"> |
||||
<path |
<path |
||||
android:fillColor="@android:color/white" |
android:fillColor="@android:color/white" |
||||
android:pathData="M11,7h2v2h-2zM11,11h2v6h-2zM12,2C6.48,2 2,6.48 2,12s4.48,10 10,10 10,-4.48 10,-10S17.52,2 12,2zM12,20c-4.41,0 -8,-3.59 -8,-8s3.59,-8 8,-8 8,3.59 8,8 -3.59,8 -8,8z"/> |
android:pathData="M11,7h2v2h-2zM11,11h2v6h-2zM12,2C6.48,2 2,6.48 2,12s4.48,10 10,10 10,-4.48 10,-10S17.52,2 12,2zM12,20c-4.41,0 -8,-3.59 -8,-8s3.59,-8 8,-8 8,3.59 8,8 -3.59,8 -8,8z"/> |
@ -0,0 +1,10 @@ |
|||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android" |
||||
|
android:width="24dp" |
||||
|
android:height="24dp" |
||||
|
android:viewportWidth="24" |
||||
|
android:viewportHeight="24" |
||||
|
android:tint="?attr/colorControlNormal"> |
||||
|
<path |
||||
|
android:fillColor="@android:color/white" |
||||
|
android:pathData="M19.43,12.98c0.04,-0.32 0.07,-0.64 0.07,-0.98 0,-0.34 -0.03,-0.66 -0.07,-0.98l2.11,-1.65c0.19,-0.15 0.24,-0.42 0.12,-0.64l-2,-3.46c-0.09,-0.16 -0.26,-0.25 -0.44,-0.25 -0.06,0 -0.12,0.01 -0.17,0.03l-2.49,1c-0.52,-0.4 -1.08,-0.73 -1.69,-0.98l-0.38,-2.65C14.46,2.18 14.25,2 14,2h-4c-0.25,0 -0.46,0.18 -0.49,0.42l-0.38,2.65c-0.61,0.25 -1.17,0.59 -1.69,0.98l-2.49,-1c-0.06,-0.02 -0.12,-0.03 -0.18,-0.03 -0.17,0 -0.34,0.09 -0.43,0.25l-2,3.46c-0.13,0.22 -0.07,0.49 0.12,0.64l2.11,1.65c-0.04,0.32 -0.07,0.65 -0.07,0.98 0,0.33 0.03,0.66 0.07,0.98l-2.11,1.65c-0.19,0.15 -0.24,0.42 -0.12,0.64l2,3.46c0.09,0.16 0.26,0.25 0.44,0.25 0.06,0 0.12,-0.01 0.17,-0.03l2.49,-1c0.52,0.4 1.08,0.73 1.69,0.98l0.38,2.65c0.03,0.24 0.24,0.42 0.49,0.42h4c0.25,0 0.46,-0.18 0.49,-0.42l0.38,-2.65c0.61,-0.25 1.17,-0.59 1.69,-0.98l2.49,1c0.06,0.02 0.12,0.03 0.18,0.03 0.17,0 0.34,-0.09 0.43,-0.25l2,-3.46c0.12,-0.22 0.07,-0.49 -0.12,-0.64l-2.11,-1.65zM17.45,11.27c0.04,0.31 0.05,0.52 0.05,0.73 0,0.21 -0.02,0.43 -0.05,0.73l-0.14,1.13 0.89,0.7 1.08,0.84 -0.7,1.21 -1.27,-0.51 -1.04,-0.42 -0.9,0.68c-0.43,0.32 -0.84,0.56 -1.25,0.73l-1.06,0.43 -0.16,1.13 -0.2,1.35h-1.4l-0.19,-1.35 -0.16,-1.13 -1.06,-0.43c-0.43,-0.18 -0.83,-0.41 -1.23,-0.71l-0.91,-0.7 -1.06,0.43 -1.27,0.51 -0.7,-1.21 1.08,-0.84 0.89,-0.7 -0.14,-1.13c-0.03,-0.31 -0.05,-0.54 -0.05,-0.74s0.02,-0.43 0.05,-0.73l0.14,-1.13 -0.89,-0.7 -1.08,-0.84 0.7,-1.21 1.27,0.51 1.04,0.42 0.9,-0.68c0.43,-0.32 0.84,-0.56 1.25,-0.73l1.06,-0.43 0.16,-1.13 0.2,-1.35h1.39l0.19,1.35 0.16,1.13 1.06,0.43c0.43,0.18 0.83,0.41 1.23,0.71l0.91,0.7 1.06,-0.43 1.27,-0.51 0.7,1.21 -1.07,0.85 -0.89,0.7 0.14,1.13zM12,8c-2.21,0 -4,1.79 -4,4s1.79,4 4,4 4,-1.79 4,-4 -1.79,-4 -4,-4zM12,14c-1.1,0 -2,-0.9 -2,-2s0.9,-2 2,-2 2,0.9 2,2 -0.9,2 -2,2z"/> |
||||
|
</vector> |
@ -0,0 +1,121 @@ |
|||||
|
<?xml version="1.0" encoding="utf-8"?> |
||||
|
<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" |
||||
|
android:layout_height="wrap_content" |
||||
|
android:background="?android:selectableItemBackground" |
||||
|
android:orientation="horizontal"> |
||||
|
|
||||
|
<FrameLayout |
||||
|
android:layout_width="@dimen/simple_item_picture_size" |
||||
|
android:layout_height="@dimen/simple_item_picture_size" |
||||
|
android:gravity="center" |
||||
|
android:padding="4dp"> |
||||
|
|
||||
|
<com.facebook.drawee.view.SimpleDraweeView |
||||
|
android:id="@+id/ivProfilePic" |
||||
|
android:layout_width="match_parent" |
||||
|
android:layout_height="match_parent" |
||||
|
app:roundAsCircle="true" /> |
||||
|
|
||||
|
<LinearLayout |
||||
|
android:id="@+id/multi_pic_container" |
||||
|
android:layout_width="match_parent" |
||||
|
android:layout_height="match_parent" |
||||
|
android:orientation="horizontal"> |
||||
|
|
||||
|
<com.facebook.drawee.view.SimpleDraweeView |
||||
|
android:layout_width="@dimen/simple_item_picture_size_half" |
||||
|
android:layout_height="match_parent" |
||||
|
app:roundAsCircle="true" /> |
||||
|
|
||||
|
<LinearLayout |
||||
|
android:layout_width="@dimen/simple_item_picture_size_half" |
||||
|
android:layout_height="match_parent" |
||||
|
android:orientation="vertical"> |
||||
|
|
||||
|
<com.facebook.drawee.view.SimpleDraweeView |
||||
|
android:layout_width="@dimen/simple_item_picture_size_half" |
||||
|
android:layout_height="@dimen/simple_item_picture_size_half" |
||||
|
app:roundAsCircle="true" /> |
||||
|
|
||||
|
<com.facebook.drawee.view.SimpleDraweeView |
||||
|
android:layout_width="@dimen/simple_item_picture_size_half" |
||||
|
android:layout_height="@dimen/simple_item_picture_size_half" |
||||
|
app:roundAsCircle="true" /> |
||||
|
</LinearLayout> |
||||
|
</LinearLayout> |
||||
|
</FrameLayout> |
||||
|
|
||||
|
<androidx.constraintlayout.widget.ConstraintLayout |
||||
|
android:layout_width="match_parent" |
||||
|
android:layout_height="wrap_content" |
||||
|
android:layout_gravity="center" |
||||
|
android:padding="8dp" |
||||
|
android:orientation="vertical"> |
||||
|
|
||||
|
<androidx.appcompat.widget.AppCompatTextView |
||||
|
android:id="@+id/tvUsername" |
||||
|
android:layout_width="wrap_content" |
||||
|
android:layout_height="0dp" |
||||
|
android:ellipsize="marquee" |
||||
|
android:gravity="center_vertical" |
||||
|
android:singleLine="true" |
||||
|
android:textAppearance="@style/TextAppearance.AppCompat.Medium" |
||||
|
android:textColor="?android:textColorPrimary" |
||||
|
android:textStyle="bold" |
||||
|
app:layout_constraintEnd_toStartOf="@id/tvDate" |
||||
|
app:layout_constraintStart_toStartOf="parent" |
||||
|
app:layout_constraintTop_toTopOf="parent" |
||||
|
tools:text="username" /> |
||||
|
|
||||
|
<androidx.appcompat.widget.AppCompatTextView |
||||
|
android:id="@+id/tvDate" |
||||
|
android:layout_width="0dp" |
||||
|
android:layout_height="0dp" |
||||
|
android:ellipsize="marquee" |
||||
|
android:gravity="center_vertical|end" |
||||
|
android:singleLine="true" |
||||
|
android:textAppearance="@style/TextAppearance.AppCompat.Caption" |
||||
|
android:textStyle="italic" |
||||
|
app:layout_constraintBottom_toTopOf="@id/comment_container" |
||||
|
app:layout_constraintEnd_toEndOf="parent" |
||||
|
app:layout_constraintStart_toEndOf="@id/tvUsername" |
||||
|
app:layout_constraintTop_toTopOf="parent" |
||||
|
tools:text="long date................................" /> |
||||
|
|
||||
|
<LinearLayout |
||||
|
android:id="@+id/comment_container" |
||||
|
android:layout_width="0dp" |
||||
|
android:layout_height="wrap_content" |
||||
|
android:orientation="horizontal" |
||||
|
app:layout_constraintBottom_toBottomOf="parent" |
||||
|
app:layout_constraintEnd_toEndOf="parent" |
||||
|
app:layout_constraintStart_toStartOf="parent" |
||||
|
app:layout_constraintTop_toBottomOf="@id/tvUsername"> |
||||
|
|
||||
|
<androidx.appcompat.widget.AppCompatImageView |
||||
|
android:id="@+id/notTextType" |
||||
|
android:layout_width="4dp" |
||||
|
android:layout_height="4dp" |
||||
|
android:layout_gravity="center_vertical" |
||||
|
android:layout_marginEnd="4dp" |
||||
|
android:layout_marginRight="4dp" |
||||
|
android:visibility="gone" |
||||
|
app:srcCompat="@android:drawable/ic_notification_overlay" |
||||
|
app:tint="@color/feed_text_primary_color" /> |
||||
|
|
||||
|
<awais.instagrabber.customviews.RamboTextView |
||||
|
android:id="@+id/tvComment" |
||||
|
android:layout_width="match_parent" |
||||
|
android:layout_height="match_parent" |
||||
|
android:layout_gravity="center_vertical" |
||||
|
android:autoLink="web|email" |
||||
|
android:ellipsize="end" |
||||
|
android:linksClickable="true" |
||||
|
android:textAppearance="@style/TextAppearance.AppCompat.Caption" |
||||
|
tools:text="comment" /> |
||||
|
</LinearLayout> |
||||
|
</androidx.constraintlayout.widget.ConstraintLayout> |
||||
|
</LinearLayout> |
@ -1,138 +0,0 @@ |
|||||
<?xml version="1.0" encoding="utf-8"?> |
|
||||
<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" |
|
||||
android:background="?android:selectableItemBackground" |
|
||||
android:orientation="horizontal" |
|
||||
android:paddingStart="0dp" |
|
||||
android:paddingLeft="0dp" |
|
||||
android:paddingEnd="4dp" |
|
||||
android:paddingRight="4dp"> |
|
||||
|
|
||||
<FrameLayout |
|
||||
android:layout_width="@dimen/simple_item_picture_size" |
|
||||
android:layout_height="@dimen/simple_item_picture_size" |
|
||||
android:gravity="center"> |
|
||||
|
|
||||
<androidx.appcompat.widget.AppCompatImageView |
|
||||
android:id="@+id/ivProfilePic" |
|
||||
android:layout_width="match_parent" |
|
||||
android:layout_height="match_parent" /> |
|
||||
|
|
||||
<LinearLayout |
|
||||
android:id="@+id/container" |
|
||||
android:layout_width="match_parent" |
|
||||
android:layout_height="match_parent" |
|
||||
android:orientation="horizontal"> |
|
||||
|
|
||||
<androidx.appcompat.widget.AppCompatImageView |
|
||||
android:layout_width="@dimen/simple_item_picture_size_half" |
|
||||
android:layout_height="match_parent" /> |
|
||||
|
|
||||
<LinearLayout |
|
||||
android:layout_width="@dimen/simple_item_picture_size_half" |
|
||||
android:layout_height="match_parent" |
|
||||
android:orientation="vertical"> |
|
||||
|
|
||||
<androidx.appcompat.widget.AppCompatImageView |
|
||||
android:layout_width="@dimen/simple_item_picture_size_half" |
|
||||
android:layout_height="@dimen/simple_item_picture_size_half" /> |
|
||||
|
|
||||
<androidx.appcompat.widget.AppCompatImageView |
|
||||
android:layout_width="@dimen/simple_item_picture_size_half" |
|
||||
android:layout_height="@dimen/simple_item_picture_size_half" /> |
|
||||
</LinearLayout> |
|
||||
</LinearLayout> |
|
||||
</FrameLayout> |
|
||||
|
|
||||
<LinearLayout |
|
||||
android:layout_width="match_parent" |
|
||||
android:layout_height="wrap_content" |
|
||||
android:orientation="vertical"> |
|
||||
|
|
||||
<androidx.appcompat.widget.AppCompatTextView |
|
||||
android:id="@+id/tvUsername" |
|
||||
android:layout_width="match_parent" |
|
||||
android:layout_height="wrap_content" |
|
||||
android:layout_gravity="start" |
|
||||
android:layout_weight="1.0" |
|
||||
android:ellipsize="marquee" |
|
||||
android:paddingStart="8dp" |
|
||||
android:paddingLeft="8dp" |
|
||||
android:paddingTop="4dp" |
|
||||
android:paddingEnd="4dp" |
|
||||
android:paddingRight="4dp" |
|
||||
android:singleLine="true" |
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Medium" |
|
||||
android:textColor="?android:textColorPrimary" |
|
||||
android:textStyle="bold" /> |
|
||||
|
|
||||
<LinearLayout |
|
||||
android:layout_width="match_parent" |
|
||||
android:layout_height="wrap_content" |
|
||||
android:orientation="horizontal" |
|
||||
android:paddingLeft="8dp" |
|
||||
android:paddingTop="4dp" |
|
||||
android:paddingRight="8dp" |
|
||||
android:paddingBottom="16dp"> |
|
||||
|
|
||||
<androidx.appcompat.widget.AppCompatImageView |
|
||||
android:id="@+id/notTextType" |
|
||||
android:layout_width="4dp" |
|
||||
android:layout_height="4dp" |
|
||||
android:layout_gravity="center_vertical" |
|
||||
android:layout_marginEnd="4dp" |
|
||||
android:layout_marginRight="4dp" |
|
||||
android:visibility="gone" |
|
||||
app:srcCompat="@android:drawable/ic_notification_overlay" |
|
||||
app:tint="@color/feed_text_primary_color" /> |
|
||||
|
|
||||
<awais.instagrabber.customviews.RamboTextView |
|
||||
android:id="@+id/tvComment" |
|
||||
android:layout_width="match_parent" |
|
||||
android:layout_height="wrap_content" |
|
||||
android:layout_gravity="start" |
|
||||
android:autoLink="web|email" |
|
||||
android:ellipsize="end" |
|
||||
android:linksClickable="true" |
|
||||
android:textAppearance="@style/TextAppearance.AppCompat" /> |
|
||||
</LinearLayout> |
|
||||
|
|
||||
<LinearLayout |
|
||||
android:layout_width="match_parent" |
|
||||
android:layout_height="wrap_content" |
|
||||
android:weightSum="3"> |
|
||||
<androidx.appcompat.widget.AppCompatTextView |
|
||||
android:id="@+id/tvLikes" |
|
||||
android:layout_width="0dp" |
|
||||
android:layout_height="wrap_content" |
|
||||
android:layout_weight="1" |
|
||||
android:ellipsize="marquee" |
|
||||
android:paddingStart="4dp" |
|
||||
android:paddingLeft="4dp" |
|
||||
android:paddingTop="4dp" |
|
||||
android:paddingEnd="8dp" |
|
||||
android:paddingRight="8dp" |
|
||||
android:singleLine="true" |
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Small" |
|
||||
android:textSize="14sp" /> |
|
||||
<androidx.appcompat.widget.AppCompatTextView |
|
||||
android:id="@+id/tvDate" |
|
||||
android:layout_width="0dp" |
|
||||
android:layout_height="wrap_content" |
|
||||
android:layout_weight="2" |
|
||||
android:layout_gravity="start" |
|
||||
android:ellipsize="marquee" |
|
||||
android:paddingStart="4dp" |
|
||||
android:paddingLeft="4dp" |
|
||||
android:paddingTop="4dp" |
|
||||
android:paddingEnd="8dp" |
|
||||
android:paddingRight="8dp" |
|
||||
android:singleLine="true" |
|
||||
android:textStyle="italic" |
|
||||
android:gravity="right"/> |
|
||||
</LinearLayout> |
|
||||
|
|
||||
</LinearLayout> |
|
||||
</LinearLayout> |
|
@ -0,0 +1,93 @@ |
|||||
|
<?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:layout_width="match_parent" |
||||
|
android:layout_height="wrap_content" |
||||
|
android:animateLayoutChanges="true" |
||||
|
android:background="?android:attr/selectableItemBackground" |
||||
|
android:gravity="center_vertical" |
||||
|
android:minHeight="?android:attr/listPreferredItemHeight" |
||||
|
android:orientation="vertical" |
||||
|
android:paddingEnd="?android:attr/scrollbarSize" |
||||
|
android:paddingRight="?android:attr/scrollbarSize"> |
||||
|
|
||||
|
<LinearLayout |
||||
|
android:layout_width="match_parent" |
||||
|
android:layout_height="wrap_content" |
||||
|
android:baselineAligned="false" |
||||
|
android:gravity="center_vertical"> |
||||
|
|
||||
|
<RelativeLayout |
||||
|
android:layout_width="0dp" |
||||
|
android:layout_height="wrap_content" |
||||
|
android:layout_marginStart="15dip" |
||||
|
android:layout_marginLeft="15dip" |
||||
|
android:layout_marginTop="6dip" |
||||
|
android:layout_marginEnd="6dip" |
||||
|
android:layout_marginRight="6dip" |
||||
|
android:layout_marginBottom="6dip" |
||||
|
android:layout_weight="1"> |
||||
|
|
||||
|
<TextView |
||||
|
android:id="@android:id/title" |
||||
|
android:layout_width="wrap_content" |
||||
|
android:layout_height="wrap_content" |
||||
|
android:ellipsize="marquee" |
||||
|
android:fadingEdge="horizontal" |
||||
|
android:singleLine="true" |
||||
|
android:textAppearance="?android:attr/textAppearanceListItem" |
||||
|
android:textColor="?android:attr/textColorPrimary" |
||||
|
tools:text="Test" /> |
||||
|
|
||||
|
<TextView |
||||
|
android:id="@android:id/summary" |
||||
|
android:layout_width="wrap_content" |
||||
|
android:layout_height="wrap_content" |
||||
|
android:layout_below="@android:id/title" |
||||
|
android:layout_alignStart="@android:id/title" |
||||
|
android:layout_alignLeft="@android:id/title" |
||||
|
android:maxLines="4" |
||||
|
android:textAppearance="?android:attr/textAppearanceListItemSmall" |
||||
|
android:textColor="?android:attr/textColorSecondary" |
||||
|
tools:text="summary" /> |
||||
|
|
||||
|
</RelativeLayout> |
||||
|
|
||||
|
<com.google.android.material.switchmaterial.SwitchMaterial |
||||
|
android:id="@+id/cbSaveTo" |
||||
|
android:layout_width="wrap_content" |
||||
|
android:layout_height="match_parent" |
||||
|
android:layout_gravity="center_vertical" |
||||
|
android:contentDescription="@string/save_to_folder" |
||||
|
android:paddingEnd="10dp" |
||||
|
android:paddingRight="10dp" /> |
||||
|
|
||||
|
</LinearLayout> |
||||
|
|
||||
|
<LinearLayout |
||||
|
android:id="@+id/button_container" |
||||
|
android:layout_width="match_parent" |
||||
|
android:layout_height="wrap_content" |
||||
|
android:layout_marginStart="15dip" |
||||
|
android:layout_marginLeft="15dip" |
||||
|
android:gravity="center_vertical" |
||||
|
android:orientation="horizontal" |
||||
|
android:visibility="gone"> |
||||
|
|
||||
|
<androidx.appcompat.widget.AppCompatButton |
||||
|
android:id="@+id/btnSaveTo" |
||||
|
android:layout_width="wrap_content" |
||||
|
android:layout_height="wrap_content" |
||||
|
android:text="@string/select_folder" /> |
||||
|
|
||||
|
<androidx.appcompat.widget.AppCompatTextView |
||||
|
android:id="@+id/custom_path" |
||||
|
android:layout_width="wrap_content" |
||||
|
android:layout_height="wrap_content" |
||||
|
android:ellipsize="marquee" |
||||
|
android:singleLine="true" |
||||
|
android:textAppearance="?android:attr/textAppearanceListItemSmall" |
||||
|
android:textColor="?android:attr/textColorSecondary" |
||||
|
tools:text="test path" /> |
||||
|
</LinearLayout> |
||||
|
</LinearLayout> |
@ -0,0 +1,14 @@ |
|||||
|
<?xml version="1.0" encoding="utf-8"?> |
||||
|
<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" |
||||
|
android:orientation="vertical"> |
||||
|
|
||||
|
<androidx.appcompat.widget.AppCompatImageView |
||||
|
android:layout_width="match_parent" |
||||
|
android:layout_height="200dp" |
||||
|
android:scaleType="fitCenter" |
||||
|
app:srcCompat="@mipmap/ic_launcher" /> |
||||
|
|
||||
|
</LinearLayout> |
@ -0,0 +1,19 @@ |
|||||
|
<?xml version="1.0" encoding="utf-8"?> |
||||
|
<navigation xmlns:android="http://schemas.android.com/apk/res/android" |
||||
|
xmlns:app="http://schemas.android.com/apk/res-auto" |
||||
|
android:id="@+id/more_nav_graph" |
||||
|
app:startDestination="@id/morePreferencesFragment"> |
||||
|
|
||||
|
<fragment |
||||
|
android:id="@+id/morePreferencesFragment" |
||||
|
android:name="awais.instagrabber.fragments.settings.MorePreferencesFragment" |
||||
|
android:label="More"> |
||||
|
<action |
||||
|
android:id="@+id/action_morePreferencesFragment_to_settingsPreferencesFragment" |
||||
|
app:destination="@id/settingsPreferencesFragment" /> |
||||
|
</fragment> |
||||
|
<fragment |
||||
|
android:id="@+id/settingsPreferencesFragment" |
||||
|
android:name="awais.instagrabber.fragments.settings.SettingsPreferencesFragment" |
||||
|
android:label="@string/action_settings" /> |
||||
|
</navigation> |