Skip to content

Commit

Permalink
3.9.2 (#781)
Browse files Browse the repository at this point in the history
* 3.9.2 ; Make imgur use user account
  • Loading branch information
Sereri authored May 20, 2024
1 parent 86d5260 commit 6b6fc42
Show file tree
Hide file tree
Showing 36 changed files with 358 additions and 438 deletions.
58 changes: 22 additions & 36 deletions Awful.apk/build.gradle
Original file line number Diff line number Diff line change
@@ -1,40 +1,31 @@
buildscript {
ext.kotlin_version = '1.7.20'
ext.kotlin_version = '1.9.21'

repositories {
google()
jcenter()
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'com.android.tools.build:gradle:7.3.1'
classpath 'com.android.tools.build:gradle:8.2.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.google.gms:google-services:4.3.14'
classpath 'com.google.firebase:firebase-crashlytics-gradle:2.9.9'

}
}

apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-kapt'
apply plugin: 'com.google.gms.google-services'
apply plugin: 'com.google.firebase.crashlytics'


repositories {
google()
jcenter()
maven { url 'https://jitpack.io' }
plugins {
id 'com.android.application'
id 'org.jetbrains.kotlin.android'
id 'com.google.devtools.ksp'
}

android {
compileSdkVersion 33
namespace "com.ferg.awfulapp"
compileSdk 34

buildFeatures {
viewBinding = true
buildConfig = true
}

defaultConfig {
applicationId = "com.ferg.awfulapp"
minSdkVersion 21
targetSdkVersion 33
minSdkVersion 24
targetSdkVersion 34
resConfigs 'en'

// Stops the Gradle plugin’s automatic rasterization of vectors
Expand Down Expand Up @@ -76,9 +67,8 @@ android {
}
}

compileOptions {
sourceCompatibility 1.8
targetCompatibility 1.8
kotlin {
jvmToolchain(17)
}

task copyThreadTags {
Expand Down Expand Up @@ -116,17 +106,17 @@ dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"

implementation 'androidx.appcompat:appcompat:1.6.1'
implementation 'com.google.android.material:material:1.9.0'
implementation 'com.google.android.material:material:1.11.0'
// these are all needed to override some old versions that are dependencies... somewhere
implementation 'androidx.media:media:1.6.0'
implementation 'androidx.media:media:1.7.0'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'

// used to fix SSL issues on older devices
implementation 'com.google.android.gms:play-services-auth:16.0.1'
implementation 'com.android.volley:volley:1.2.1'


implementation 'com.google.code.gson:gson:2.8.9'
implementation 'com.google.code.gson:gson:2.10'

implementation 'org.jsoup:jsoup:1.15.4'
implementation 'com.jakewharton.threetenabp:threetenabp:1.2.4'
Expand All @@ -142,16 +132,12 @@ dependencies {
implementation 'com.ToxicBakery.viewpager.transforms:view-pager-transforms:2.0.24@aar'
implementation 'com.github.orangegangsters:swipy:1.2.3@aar'
implementation 'com.bignerdranch.android:expandablerecyclerview:2.1.1'
implementation 'com.jakewharton:butterknife:10.2.1'
implementation 'com.jakewharton.timber:timber:4.7.1'

implementation 'com.github.bumptech.glide:glide:4.11.0'
kapt 'com.github.bumptech.glide:compiler:4.11.0'
implementation 'com.github.bumptech.glide:glide:4.16.0'
ksp 'com.github.bumptech.glide:ksp:4.16.0'

implementation 'com.github.chrisbanes:PhotoView:2.3.0'
kapt 'com.jakewharton:butterknife-compiler:10.2.1'

implementation 'com.google.firebase:firebase-crashlytics:18.4.3'

implementation 'com.github.rubensousa:BottomSheetBuilder:1.5.1'

Expand Down
4 changes: 2 additions & 2 deletions Awful.apk/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.ferg.awfulapp"
android:versionCode="30901"
android:versionName="3.9.1"
android:versionCode="30902"
android:versionName="3.9.2"
android:installLocation="auto">
<supports-screens
android:smallScreens="true"
Expand Down
8 changes: 8 additions & 0 deletions Awful.apk/src/main/assets/changelog.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,14 @@
<!-- See the Changelog code for the expected structure of this document -->

<main>
<section>
<h2>3.9.2</h2>
<ul>
<li>Made imgur upload work again. You can finally uninstall that awful app. No, I mean theirs. I should have written terrible app, that's clearer.</li>
<li>Removed crash report library because Google considers it collecting user data. Now collecting user data via the base functionality again like in 2012. Remember to include your username in the crash reports. Or don't, that's ok too.</li>
<li>Removed some older libraries that are no longer maintained. Something might have broken? If you see something, say something</li>
</ul>
</section>
<section>
<h2>3.9.1</h2>
<ul>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import com.ferg.awfulapp.preferences.AwfulPreferences
class LogOutDialog : DialogFragment() {

override fun onCreateDialog(savedInstanceState: Bundle?): Dialog =
AlertDialog.Builder(activity!!)
AlertDialog.Builder(requireActivity())
.setTitle(R.string.logout)
.setMessage(R.string.logout_message)
.setPositiveButton(R.string.logout, { _, _ ->
Expand Down
24 changes: 0 additions & 24 deletions Awful.apk/src/main/java/com/ferg/awfulapp/AwfulApplication.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import android.os.StrictMode;
import android.webkit.WebView;

import com.google.firebase.crashlytics.FirebaseCrashlytics;
import com.ferg.awfulapp.announcements.AnnouncementsManager;
import com.ferg.awfulapp.constants.Constants;
import com.ferg.awfulapp.network.NetworkUtils;
Expand All @@ -26,7 +25,6 @@ public class AwfulApplication extends Application {
* Used for storing misc app data, separate from user preferences, so onPreferenceChange callbacks aren't triggered
*/
private static SharedPreferences appStatePrefs;
private static boolean crashlyticsEnabled = false;

/**
* Stores the user agent used by web views in this application, which is required to be
Expand Down Expand Up @@ -71,21 +69,6 @@ public void onCreate() {

long hoursSinceInstall = getHoursSinceInstall();

// enable Crashlytics on non-debug builds, or debug builds that have been installed for a while
crashlyticsEnabled = !BuildConfig.DEBUG || hoursSinceInstall > 4;

if (crashlyticsEnabled) {
FirebaseCrashlytics.getInstance().setCrashlyticsCollectionEnabled(true);
FirebaseCrashlytics crashlytics = FirebaseCrashlytics.getInstance();

if (mPref.sendUsernameInReport)
crashlytics.setUserId(mPref.username);
} else {
FirebaseCrashlytics.getInstance().setCrashlyticsCollectionEnabled(false);
}

Timber.plant(crashlyticsEnabled ? new CrashlyticsReportingTree() : new Timber.DebugTree());

Timber.i("App installed %d hours ago", hoursSinceInstall);

if (Constants.DEBUG) {
Expand Down Expand Up @@ -120,13 +103,6 @@ private long getHoursSinceInstall() {
return hoursSinceInstall;
}

/**
* Returns true if the Crashlytics singleton has been initialised and can be used.
*/
public static boolean crashlyticsEnabled() {
return crashlyticsEnabled;
}

/**
* Get the SharedPreferences used for storing basic app state.
* <p>
Expand Down
2 changes: 1 addition & 1 deletion Awful.apk/src/main/java/com/ferg/awfulapp/AwfulFragment.kt
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ abstract class AwfulFragment : Fragment(), AwfulPreferences.AwfulPreferenceUpdat
AwfulRequest.ProgressListener, ForumsPagerPage, NavigationEventHandler {
protected var TAG = "AwfulFragment"

protected val prefs: AwfulPreferences by lazy { AwfulPreferences.getInstance(context!!, this) }
protected val prefs: AwfulPreferences by lazy { AwfulPreferences.getInstance(requireContext(), this) }
protected val handler: Handler by lazy { Handler() }
protected val alertView: AlertView by lazy { AlertView(activity) }

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
import android.os.Bundle;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import com.ferg.awfulapp.databinding.ForumIndexFragmentBinding;
import com.google.android.material.snackbar.Snackbar;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
Expand All @@ -27,9 +29,6 @@
import java.util.ArrayList;
import java.util.List;

import butterknife.BindView;
import butterknife.ButterKnife;

import static com.ferg.awfulapp.forums.ForumStructure.FLAT;
import static com.ferg.awfulapp.forums.ForumStructure.TWO_LEVEL;

Expand All @@ -55,11 +54,8 @@ public class ForumsIndexFragment extends AwfulFragment

private static final String KEY_SHOW_FAVOURITES = "show_favourites";

@BindView(R.id.forum_index_list)
RecyclerView forumRecyclerView;
@BindView(R.id.view_switcher)
ViewSwitcher forumsListSwitcher;
@BindView(R.id.status_frog)
StatusFrog statusFrog;

private ForumListAdapter forumListAdapter;
Expand Down Expand Up @@ -91,8 +87,11 @@ public void onCreate(Bundle savedInstanceState) {

@Override
public View onCreateView(@NonNull LayoutInflater aInflater, ViewGroup aContainer, Bundle aSavedState) {
View view = inflateView(R.layout.forum_index_fragment, aContainer, aInflater);
ButterKnife.bind(this, view);
ForumIndexFragmentBinding binding = ForumIndexFragmentBinding.inflate(getLayoutInflater());
View view = binding.getRoot();
forumRecyclerView = binding.forumIndexList;
forumsListSwitcher = binding.viewSwitcher;
statusFrog = binding.statusFrog;
updateViewColours();
refreshProbationBar();
forumsListSwitcher.setInAnimation(AnimationUtils.makeInAnimation(getContext(), true));
Expand Down
10 changes: 5 additions & 5 deletions Awful.apk/src/main/java/com/ferg/awfulapp/PostReplyActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,21 +32,21 @@
import androidx.appcompat.widget.Toolbar;
import android.view.MenuItem;

import butterknife.BindView;
import butterknife.ButterKnife;
import com.ferg.awfulapp.databinding.PostReplyActivityBinding;


public class PostReplyActivity extends AwfulActivity {

@BindView(R.id.toolbar)

Toolbar mToolbar;
PostReplyFragment replyFragment;

@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.post_reply_activity);
ButterKnife.bind(this);
PostReplyActivityBinding binding = PostReplyActivityBinding.inflate(getLayoutInflater());
setContentView(binding.getRoot());
mToolbar = binding.toolbar;

setSupportActionBar(mToolbar);
setUpActionBar();
Expand Down
13 changes: 6 additions & 7 deletions Awful.apk/src/main/java/com/ferg/awfulapp/PostReplyFragment.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@
import android.provider.MediaStore;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import com.ferg.awfulapp.databinding.PostReplyActivityBinding;
import com.google.android.material.snackbar.Snackbar;
import androidx.fragment.app.DialogFragment;
import androidx.fragment.app.FragmentManager;
Expand Down Expand Up @@ -92,11 +94,10 @@
import org.apache.commons.lang3.StringUtils;
import org.threeten.bp.Duration;
import org.threeten.bp.Instant;
import org.w3c.dom.Text;

import java.io.File;

import butterknife.BindView;
import butterknife.ButterKnife;
import timber.log.Timber;

import static com.ferg.awfulapp.constants.Constants.ATTACHMENT_MAX_BYTES;
Expand All @@ -118,8 +119,6 @@ public class PostReplyFragment extends AwfulFragment {
private static final String TAG = "PostReplyFragment";

// UI components
@BindView(R.id.thread_title)
TextView threadTitleView = null;
private MessageComposer messageComposer;
@Nullable
private ProgressDialog progressDialog;
Expand Down Expand Up @@ -172,16 +171,15 @@ public void onCreate(Bundle savedInstanceState) {
public View onCreateView(LayoutInflater aInflater, ViewGroup aContainer, Bundle aSavedState) {
super.onCreateView(aInflater, aContainer, aSavedState);
Timber.v("onCreateView");
return inflateView(R.layout.post_reply, aContainer, aInflater);
View view = inflateView(R.layout.post_reply, aContainer, aInflater);
return view;
}


@Override
public void onActivityCreated(Bundle aSavedState) {
super.onActivityCreated(aSavedState);
Timber.v("onActivityCreated");
Activity activity = getActivity();
ButterKnife.bind(this, activity);

messageComposer = (MessageComposer) getChildFragmentManager().findFragmentById(R.id.message_composer_fragment);
messageComposer.setBackgroundColor(ColorProvider.BACKGROUND.getColor());
Expand Down Expand Up @@ -1042,6 +1040,7 @@ private void dismissProgressDialog() {
* Update the title view to show the current thread title, if we have it
*/
private void updateThreadTitle() {
TextView threadTitleView = getActivity().findViewById(R.id.thread_title);
if (threadTitleView != null) {
threadTitleView.setText(mThreadTitle == null ? "" : mThreadTitle);
}
Expand Down
Loading

0 comments on commit 6b6fc42

Please sign in to comment.