mirror of
https://codeberg.org/Bazsalanszky/Infinity-For-Lemmy.git
synced 2025-02-16 02:48:42 +01:00
Compare commits
3 Commits
0ea491bcfc
...
053c9e73b0
Author | SHA1 | Date | |
---|---|---|---|
|
053c9e73b0 | ||
|
acd1aef851 | ||
|
a3a753a9dd |
@ -2,6 +2,18 @@ plugins {
|
|||||||
id 'com.android.application'
|
id 'com.android.application'
|
||||||
id 'org.jetbrains.kotlin.android'
|
id 'org.jetbrains.kotlin.android'
|
||||||
}
|
}
|
||||||
|
def getCommitVersionCode = { ->
|
||||||
|
try {
|
||||||
|
def stdout = new ByteArrayOutputStream()
|
||||||
|
exec {
|
||||||
|
commandLine 'git', 'rev-list', 'HEAD', '--count'
|
||||||
|
standardOutput = stdout
|
||||||
|
}
|
||||||
|
return Integer.valueOf(stdout.toString().trim())
|
||||||
|
} catch (ignored) {
|
||||||
|
return null
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
android {
|
android {
|
||||||
compileSdk 33
|
compileSdk 33
|
||||||
@ -19,10 +31,12 @@ android {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
buildTypes {
|
buildTypes {
|
||||||
|
|
||||||
release {
|
release {
|
||||||
minifyEnabled false
|
minifyEnabled false
|
||||||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||||
}
|
}
|
||||||
|
|
||||||
minifiedRelease {
|
minifiedRelease {
|
||||||
initWith buildTypes.release
|
initWith buildTypes.release
|
||||||
zipAlignEnabled true
|
zipAlignEnabled true
|
||||||
@ -34,6 +48,27 @@ android {
|
|||||||
applicationIdSuffix '.debug'
|
applicationIdSuffix '.debug'
|
||||||
versionNameSuffix ' (DEBUG)'
|
versionNameSuffix ' (DEBUG)'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
nightly {
|
||||||
|
minifyEnabled false
|
||||||
|
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||||
|
applicationIdSuffix '.nightly'
|
||||||
|
versionNameSuffix ' (NIGHTLY)'
|
||||||
|
}
|
||||||
|
applicationVariants.all { variant ->
|
||||||
|
variant.resValue "string", "applicationId", variant.applicationId
|
||||||
|
|
||||||
|
|
||||||
|
if (variant.buildType.name == 'nightly' || variant.buildType.name == 'nopebble') {
|
||||||
|
variant.outputs.all {
|
||||||
|
setVersionCodeOverride(getCommitVersionCode())
|
||||||
|
|
||||||
|
setVersionNameOverride(variant.versionName)
|
||||||
|
outputFileName = "${applicationId}_${variant.versionName}.apk"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
sourceSets {
|
sourceSets {
|
||||||
@ -207,3 +242,4 @@ dependencies {
|
|||||||
// debugImplementation because LeakCanary should only run in debug builds.
|
// debugImplementation because LeakCanary should only run in debug builds.
|
||||||
//debugImplementation 'com.squareup.leakcanary:leakcanary-android:x.y'
|
//debugImplementation 'com.squareup.leakcanary:leakcanary-android:x.y'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -308,7 +308,7 @@ public class EditPostActivity extends BaseActivity implements UploadImageEnabled
|
|||||||
isSubmitting = true;
|
isSubmitting = true;
|
||||||
|
|
||||||
Snackbar.make(coordinatorLayout, R.string.posting, Snackbar.LENGTH_SHORT).show();
|
Snackbar.make(coordinatorLayout, R.string.posting, Snackbar.LENGTH_SHORT).show();
|
||||||
mRetrofit.getRetrofit().create(LemmyAPI.class).postUpdate(new EditPostDTO(mPost.getId(), titleEditText.getText().toString(), linkEditText.getText().toString(), contentEditText.getText().toString(), mPost.isNSFW(), null, mAccessToken))
|
mRetrofit.getRetrofit().create(LemmyAPI.class).postUpdate(new EditPostDTO(mPost.getId(), titleEditText.getText().toString(), (linkEditText.getText().toString().isEmpty()) ? null : linkEditText.getText().toString(), contentEditText.getText().toString(), mPost.isNSFW(), null, mAccessToken))
|
||||||
.enqueue(new Callback<String>() {
|
.enqueue(new Callback<String>() {
|
||||||
@Override
|
@Override
|
||||||
public void onResponse(@NonNull Call<String> call, @NonNull Response<String> response) {
|
public void onResponse(@NonNull Call<String> call, @NonNull Response<String> response) {
|
||||||
|
@ -174,7 +174,7 @@ public class ParsePost {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
String title = post.getString("name");
|
String title = post.getString("name").replace("&", "&");
|
||||||
String permalink = post.getString("ap_id");
|
String permalink = post.getString("ap_id");
|
||||||
int score = counts.getInt("score");
|
int score = counts.getInt("score");
|
||||||
int upvotes = counts.getInt("upvotes");
|
int upvotes = counts.getInt("upvotes");
|
||||||
|
@ -34,7 +34,7 @@ public class ParseSubredditData {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
String title = community.getString(JSONUtils.TITLE_KEY);
|
String title = community.getString(JSONUtils.TITLE_KEY).replace("&", "&");
|
||||||
String bannerImageUrl = "";
|
String bannerImageUrl = "";
|
||||||
if (!community.isNull("banner")) {
|
if (!community.isNull("banner")) {
|
||||||
bannerImageUrl = community.getString("banner");
|
bannerImageUrl = community.getString("banner");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user