Compare commits

...

5 Commits

Author SHA1 Message Date
rubenwardy 90792b7ad8 Release 1.9.1 2019-08-06 23:06:02 +01:00
rubenwardy b3bdbb576d Release 1.9.0 2019-06-25 00:20:26 +01:00
rubenwardy 09bb2f2149 Fix status bar problems 2019-06-25 00:06:44 +01:00
rubenwardy a97e8ea93e Add donate, source, and translate buttons to app 2019-06-25 00:06:37 +01:00
rubenwardy 7a724b1f8e Add support for thumbnails 2019-06-24 23:51:09 +01:00
19 changed files with 336 additions and 85 deletions

307
.gitignore vendored
View File

@ -7,14 +7,17 @@
/build
/captures
*.apk
# Created by https://www.gitignore.io/api/android,intellij,java
# Created by https://www.gitignore.io/api/java,linux,macos,android,windows,intellij,androidstudio
# Edit at https://www.gitignore.io/?templates=java,linux,macos,android,windows,intellij,androidstudio
### Android ###
# Built application files
*.apk
*.ap_
*.aab
# Files for the Dalvik VM
# Files for the ART/Dalvik VM
*.dex
# Java class files
@ -44,80 +47,316 @@ proguard/
# Android Studio captures folder
captures/
# Intellij
# IntelliJ
*.iml
.idea/workspace.xml
.idea/tasks.xml
.idea/gradle.xml
.idea/assetWizardSettings.xml
.idea/dictionaries
.idea/libraries
.idea/caches
# Android Studio 3 in .gitignore file.
.idea/caches/build_file_checksums.ser
.idea/modules.xml
# Keystore files
*.jks
# Uncomment the following lines if you do not want to check your keystore files in.
#*.jks
#*.keystore
# External native build folder generated in Android Studio 2.2 and later
.externalNativeBuild
# Google Services (e.g. APIs or Firebase)
# google-services.json
# Freeline
freeline.py
freeline/
freeline_project_description.json
# fastlane
fastlane/report.xml
fastlane/Preview.html
fastlane/screenshots
fastlane/test_output
fastlane/readme.md
# Version control
vcs.xml
# lint
lint/intermediates/
lint/generated/
lint/outputs/
lint/tmp/
# lint/reports/
### Android Patch ###
gen-external-apklibs
output.json
### AndroidStudio ###
# Covers files to be ignored for android development using Android Studio.
### Intellij ###
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
# Built application files
# User-specific stuff:
.idea/workspace.xml
.idea/tasks.xml
.idea/dictionaries
# Files for the ART/Dalvik VM
# Java class files
# Generated files
# Gradle files
.gradle
# Signing files
.signing/
# Local configuration file (sdk path, etc)
# Proguard folder generated by Eclipse
# Log Files
# Android Studio
/*/build/
/*/local.properties
/*/out
/*/*/build
/*/*/production
*.ipr
*~
*.swp
# Android Patch
# External native build folder generated in Android Studio 2.2 and later
# NDK
obj/
# IntelliJ IDEA
*.iws
/out/
# User-specific configurations
.idea/caches/
.idea/libraries/
.idea/shelf/
.idea/.name
.idea/compiler.xml
.idea/copyright/profiles_settings.xml
.idea/encodings.xml
.idea/misc.xml
.idea/scopes/scope_settings.xml
.idea/vcs.xml
.idea/jsLibraryMappings.xml
# Sensitive or high-churn files:
.idea/datasources.xml
.idea/dataSources.ids
.idea/dataSources.xml
.idea/dataSources.local.xml
.idea/sqlDataSources.xml
.idea/dynamic.xml
.idea/uiDesigner.xml
# Gradle:
.idea/gradle.xml
.idea/libraries
# OS-specific files
.DS_Store
.DS_Store?
._*
.Spotlight-V100
.Trashes
ehthumbs.db
Thumbs.db
# Mongo Explorer plugin:
.idea/mongoSettings.xml
# Legacy Eclipse project files
.classpath
.project
.cproject
.settings/
## File-based project format:
*.iws
# Mobile Tools for Java (J2ME)
.mtj.tmp/
# Package Files #
*.war
*.ear
# virtual machine crash logs (Reference: http://www.java.com/en/download/help/error_hotspot.xml)
hs_err_pid*
## Plugin-specific files:
# IntelliJ
/out/
# mpeltonen/sbt-idea plugin
.idea_modules/
# JIRA plugin
atlassian-ide-plugin.xml
# Mongo Explorer plugin
.idea/mongoSettings.xml
# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
fabric.properties
### Intellij Patch ###
*.iml
### AndroidStudio Patch ###
!/gradle/wrapper/gradle-wrapper.jar
### Intellij ###
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and WebStorm
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
# User-specific stuff
.idea/**/workspace.xml
.idea/**/tasks.xml
.idea/**/usage.statistics.xml
.idea/**/dictionaries
.idea/**/shelf
# Generated files
.idea/**/contentModel.xml
# Sensitive or high-churn files
.idea/**/dataSources/
.idea/**/dataSources.ids
.idea/**/dataSources.local.xml
.idea/**/sqlDataSources.xml
.idea/**/dynamic.xml
.idea/**/uiDesigner.xml
.idea/**/dbnavigator.xml
# Gradle
.idea/**/gradle.xml
.idea/**/libraries
# Gradle and Maven with auto-import
# When using Gradle or Maven with auto-import, you should exclude module files,
# since they will be recreated, and may cause churn. Uncomment if using
# auto-import.
# .idea/modules.xml
# .idea/*.iml
# .idea/modules
# CMake
cmake-build-*/
# Mongo Explorer plugin
.idea/**/mongoSettings.xml
# File-based project format
# IntelliJ
# mpeltonen/sbt-idea plugin
# JIRA plugin
# Cursive Clojure plugin
.idea/replstate.xml
# Crashlytics plugin (for Android Studio and IntelliJ)
# Editor-based Rest Client
.idea/httpRequests
# Android studio 3.1+ serialized cache file
# JetBrains templates
**___jb_tmp___
### Intellij Patch ###
# Comment Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-215987721
# *.iml
# modules.xml
# .idea/misc.xml
# *.ipr
# Sonarlint plugin
.idea/sonarlint
### Java ###
*.class
# Compiled class file
# Log file
# BlueJ files
*.ctxt
# Mobile Tools for Java (J2ME)
.mtj.tmp/
# Package Files #
*.jar
*.war
*.ear
!gradle/wrapper/*.jar
*.nar
*.zip
*.tar.gz
*.rar
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
### Linux ###
# temporary files which can be created if a process still has a handle open of a deleted file
.fuse_hidden*
# KDE directory preferences
.directory
# Linux trash folder which might appear on any partition or disk
.Trash-*
# .nfs files are created when an open file is removed but is still being accessed
.nfs*
### macOS ###
# General
.AppleDouble
.LSOverride
# Icon must end with two \r
Icon
# Thumbnails
# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.TemporaryItems
.VolumeIcon.icns
.com.apple.timemachine.donotpresent
# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk
### Windows ###
# Windows thumbnail cache files
ehthumbs_vista.db
# Dump file
*.stackdump
# Folder config file
[Dd]esktop.ini
# Recycle Bin used on file shares
$RECYCLE.BIN/
# Windows Installer files
*.cab
*.msi
*.msix
*.msm
*.msp
# Windows shortcuts
*.lnk
# End of https://www.gitignore.io/api/java,linux,macos,android,windows,intellij,androidstudio
\.idea/kotlinc\.xml

View File

@ -1,29 +0,0 @@
<component name="ProjectCodeStyleConfiguration">
<code_scheme name="Project" version="173">
<Objective-C-extensions>
<file>
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Import" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Macro" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Typedef" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Enum" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Constant" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Global" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Struct" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="FunctionPredecl" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Function" />
</file>
<class>
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Property" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Synthesize" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="InitMethod" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="StaticMethod" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="InstanceMethod" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="DeallocMethod" />
</class>
<extensions>
<pair source="cpp" header="h" fileNamingConvention="NONE" />
<pair source="c" header="h" fileNamingConvention="NONE" />
</extensions>
</Objective-C-extensions>
</code_scheme>
</component>

View File

@ -5,7 +5,7 @@
<option name="myDefaultNotNull" value="android.support.annotation.NonNull" />
<option name="myNullables">
<value>
<list size="7">
<list size="10">
<item index="0" class="java.lang.String" itemvalue="org.jetbrains.annotations.Nullable" />
<item index="1" class="java.lang.String" itemvalue="javax.annotation.Nullable" />
<item index="2" class="java.lang.String" itemvalue="javax.annotation.CheckForNull" />
@ -13,23 +13,29 @@
<item index="4" class="java.lang.String" itemvalue="android.support.annotation.Nullable" />
<item index="5" class="java.lang.String" itemvalue="androidx.annotation.Nullable" />
<item index="6" class="java.lang.String" itemvalue="androidx.annotation.RecentlyNullable" />
<item index="7" class="java.lang.String" itemvalue="org.checkerframework.checker.nullness.qual.Nullable" />
<item index="8" class="java.lang.String" itemvalue="org.checkerframework.checker.nullness.compatqual.NullableDecl" />
<item index="9" class="java.lang.String" itemvalue="org.checkerframework.checker.nullness.compatqual.NullableType" />
</list>
</value>
</option>
<option name="myNotNulls">
<value>
<list size="6">
<list size="9">
<item index="0" class="java.lang.String" itemvalue="org.jetbrains.annotations.NotNull" />
<item index="1" class="java.lang.String" itemvalue="javax.annotation.Nonnull" />
<item index="2" class="java.lang.String" itemvalue="edu.umd.cs.findbugs.annotations.NonNull" />
<item index="3" class="java.lang.String" itemvalue="android.support.annotation.NonNull" />
<item index="4" class="java.lang.String" itemvalue="androidx.annotation.NonNull" />
<item index="5" class="java.lang.String" itemvalue="androidx.annotation.RecentlyNonNull" />
<item index="6" class="java.lang.String" itemvalue="org.checkerframework.checker.nullness.qual.NonNull" />
<item index="7" class="java.lang.String" itemvalue="org.checkerframework.checker.nullness.compatqual.NonNullDecl" />
<item index="8" class="java.lang.String" itemvalue="org.checkerframework.checker.nullness.compatqual.NonNullType" />
</list>
</value>
</option>
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/build/classes" />
</component>
<component name="ProjectType">

View File

@ -3,6 +3,7 @@
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/app/app.iml" filepath="$PROJECT_DIR$/app/app.iml" />
<module fileurl="file://$PROJECT_DIR$/.idea/mtmods4android.iml" filepath="$PROJECT_DIR$/.idea/mtmods4android.iml" />
<module fileurl="file://$PROJECT_DIR$/mtmods4android.iml" filepath="$PROJECT_DIR$/mtmods4android.iml" />
</modules>
</component>

View File

@ -9,8 +9,8 @@ android {
applicationId "com.rubenwardy.minetestmodmanager"
minSdkVersion 14
targetSdkVersion 28
versionCode 19
versionName "1.8.0"
versionCode 23
versionName "1.9.1"
buildConfigField "boolean", "ENABLE_RATE_ME", "false"
}
buildTypes {

View File

@ -37,7 +37,7 @@
android:name=".views.ModDetailActivity"
android:label="@string/mod_title"
android:parentActivityName=".views.ModListActivity"
android:theme="@style/AppTheme.NoActionBar">
android:theme="@style/AppTheme.NoStatusBar">
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="com.rubenwardy.minetestmodmanager.views.ModListActivity" />

View File

@ -23,6 +23,7 @@ public class Mod extends ModSpec {
@NonNull public String link;
@Nullable public String path;
@Nullable public String thumbnail_url;
@Nullable public String screenshot_uri;
@Nullable public String forum_url;
public int verified;
@ -38,6 +39,7 @@ public class Mod extends ModSpec {
this.link = "";
this.path = "";
this.screenshot_uri = "";
this.thumbnail_url = null;
this.verified = 0;
this.size = -1;
}

View File

@ -59,6 +59,7 @@ public interface StoreAPI {
public String description;
public String forum_url;
public String download_link;
public String thumbnail;
@Nullable
Mod toMod(final String modstore_url) {
@ -97,6 +98,7 @@ public interface StoreAPI {
mod.author = author;
mod.forum_url = forum;
mod.size = 0;
mod.thumbnail_url = thumbnail;
return mod;
}

View File

@ -150,10 +150,10 @@ public class ModDetailActivity
Picasso.get()
.load(new File(mod.screenshot_uri))
.into(target);
} else if (!mod.isLocalMod()) {
} else if (!mod.isLocalMod() && mod.thumbnail_url != null) {
ctoolbar.setTag(target);
Picasso.get()
.load("https://minetest-mods.rubenwardy.com/screenshot/" + mod.author + "/" + mod.name + "/")
.load(mod.thumbnail_url.replace("https://content.minetest.net/thumbnails/1/", "https://content.minetest.net/thumbnails/3/"))
.into(target);
}

View File

@ -674,9 +674,9 @@ public class ModListActivity
.error(R.drawable.mod_preview_circle)
.placeholder(R.drawable.mod_preview_circle)
.into(holder.view_preview, callback);
} else if (!mod.isLocalMod()) {
} else if (mod.thumbnail_url != null) {
Picasso.get()
.load("https://minetest-mods.rubenwardy.com/screenshot/" + mod.author + "/" + mod.name + "/")
.load(mod.thumbnail_url)
.fit()
.error(R.drawable.mod_preview_circle)
.placeholder(R.drawable.mod_preview_circle)

View File

@ -172,9 +172,7 @@ class SectionedRecyclerViewAdapter extends RecyclerView.Adapter<RecyclerView.Vie
Arrays.sort(sections, new Comparator<Section>() {
@Override
public int compare(@NonNull Section o, @NonNull Section o1) {
return (o.firstPosition == o1.firstPosition)
? 0
: ((o.firstPosition < o1.firstPosition) ? -1 : 1);
return Integer.compare(o.firstPosition, o1.firstPosition);
}
});

View File

@ -13,6 +13,7 @@ import android.content.Intent
import android.app.AlarmManager
import android.app.PendingIntent
import android.content.Context
import android.net.Uri
import android.util.Log
import android.widget.Switch
@ -67,6 +68,16 @@ class SettingsAndAboutActivity : AppCompatActivity() {
mgr.set(AlarmManager.RTC, System.currentTimeMillis() + 100, mPendingIntent)
System.exit(0)
}
findViewById<View>(R.id.source).setOnClickListener {
val browserIntent = Intent(Intent.ACTION_VIEW, Uri.parse("https://github.com/rubenwardy/mtmods4android/"))
startActivity(browserIntent)
}
findViewById<View>(R.id.translate).setOnClickListener {
val browserIntent = Intent(Intent.ACTION_VIEW, Uri.parse("https://hosted.weblate.org/projects/minetest/mtmods4android/"))
startActivity(browserIntent)
}
}
}

View File

@ -119,6 +119,26 @@
android:layout_height="wrap_content"
android:text="@string/about_credits_images"
android:layout_marginTop="10dp" />
<LinearLayout
android:layout_marginTop="10dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<Button
android:id="@+id/source"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/source_code" />
<Button
android:id="@+id/translate"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/translate" />
</LinearLayout>
</LinearLayout>
</android.support.v4.widget.NestedScrollView>

View File

@ -1,8 +1,6 @@
<resources>>
<style name="AppTheme.NoActionBar">
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
<style name="AppTheme.NoStatusBar" parent="AppTheme.NoActionBar">
<item name="android:windowDrawsSystemBarBackgrounds">true</item>
<item name="android:statusBarColor">@android:color/transparent</item>
</style>

View File

@ -157,6 +157,9 @@
<string name="settings_theme_restart_hint">A restart is required for theme changes to take effect outside of the settings screen.</string>
<string name="settings_theme_restart">Restart</string>
<string name="perm_storage_needed">Storage permission needed</string>
<string name="donate">Donate</string>
<string name="source_code">Source Code</string>
<string name="translate">Translate</string>
<string-array name="settings_theme_options">
<item>System Default</item>
<item>Light Theme</item>

View File

@ -32,6 +32,9 @@
<item name="windowNoTitle">true</item>
</style>
<style name="AppTheme.NoStatusBar" parent="AppTheme.NoActionBar">
</style>
<style name="AppTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar" />
<style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Light" />

View File

@ -11,7 +11,7 @@ buildscript {
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
classpath 'com.android.tools.build:gradle:3.4.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
// NOTE: Do not place your application dependencies here; they belong
@ -29,9 +29,6 @@ allprojects {
}
}
task wrapper(type: Wrapper) {
gradleVersion = '2.3.1'
}
task clean(type: Delete) {
delete rootProject.buildDir

View File

@ -1,6 +1,6 @@
#Wed Nov 21 11:32:11 GMT 2018
#Tue Jun 25 01:40:11 BST 2019
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-5.1.1-all.zip