diff --git a/.gitignore b/.gitignore
index 252008e0..8df35eb6 100644
--- a/.gitignore
+++ b/.gitignore
@@ -46,5 +46,5 @@ captures/
### Android Patch ###
gen-external-apklibs
-# Google Services (release build)
-app/src/release/google-services.json
\ No newline at end of file
+# Google Services JSON
+google-services.json
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 851425b8..1788ca59 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -2,30 +2,38 @@ image: openjdk:8-jdk
variables:
ANDROID_TARGET_SDK: "26"
- ANDROID_BUILD_TOOLS: "26.0.1"
- ANDROID_SDK_TOOLS: "25.2.5"
+ ANDROID_BUILD_TOOLS: "27.0.0"
+ ANDROID_SDK_TOOLS_REV: "3859397"
before_script:
- apt-get --quiet update --yes
- - apt-get --quiet install --yes wget tar unzip lib32stdc++6 lib32z1
- - wget --quiet --output-document=android-sdk.zip https://dl.google.com/android/repository/tools_r${ANDROID_SDK_TOOLS}-linux.zip
- - unzip android-sdk.zip -d android-sdk-linux
- - echo y | android-sdk-linux/tools/android --silent update sdk --no-ui --all --filter android-${ANDROID_TARGET_SDK}
- - echo y | android-sdk-linux/tools/android --silent update sdk --no-ui --all --filter platform-tools
- - echo y | android-sdk-linux/tools/android --silent update sdk --no-ui --all --filter build-tools-${ANDROID_BUILD_TOOLS}
- - echo y | android-sdk-linux/tools/android --silent update sdk --no-ui --all --filter extra-android-m2repository
- - echo y | android-sdk-linux/tools/android --silent update sdk --no-ui --all --filter extra-google-google_play_services
- - echo y | android-sdk-linux/tools/android --silent update sdk --no-ui --all --filter extra-google-m2repository
+ - apt-get --quiet install --yes wget unzip lib32stdc++6 lib32z1
+ - mkdir $HOME/.android # for sdkmanager configs
+ - echo 'count=0' > $HOME/.android/repositories.cfg # avoid warning
+ - wget --quiet --output-document=android-sdk.zip https://dl.google.com/android/repository/sdk-tools-linux-${ANDROID_SDK_TOOLS_REV}.zip
+ - mkdir $PWD/android-sdk-linux
+ - unzip -qq android-sdk.zip -d $PWD/android-sdk-linux
- export ANDROID_HOME=$PWD/android-sdk-linux
- - export PATH=$PATH:$PWD/android-sdk-linux/platform-tools/
+ - echo y | $ANDROID_HOME/tools/bin/sdkmanager --update > /dev/null
+ - echo y | $ANDROID_HOME/tools/bin/sdkmanager 'tools' > /dev/null
+ - echo y | $ANDROID_HOME/tools/bin/sdkmanager 'platform-tools' > /dev/null
+ - echo y | $ANDROID_HOME/tools/bin/sdkmanager 'build-tools;'$ANDROID_BUILD_TOOLS > /dev/null
+ - echo y | $ANDROID_HOME/tools/bin/sdkmanager 'platforms;android-'$ANDROID_TARGET_SDK > /dev/null
+ - echo y | $ANDROID_HOME/tools/bin/sdkmanager 'extras;android;m2repository' > /dev/null
+ - echo y | $ANDROID_HOME/tools/bin/sdkmanager 'extras;google;google_play_services' > /dev/null
+ - echo y | $ANDROID_HOME/tools/bin/sdkmanager 'extras;google;m2repository' > /dev/null
- chmod +x ./gradlew
-build_develop:
+stages:
+ - build
+
+build:
+ stage: build
script:
- - ./gradlew assembleDebug
+ - ./gradlew assembleDebug > /dev/null
except:
- master
artifacts:
name: "${CI_BUILD_NAME}"
paths:
- - app/build/outputs/apk
+ - app/build/outputs/
diff --git a/VERSION b/VERSION
index 1892b926..31e5c843 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-1.3.2
+1.3.3
diff --git a/app/build.gradle b/app/build.gradle
index 719a0366..d6341ed7 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -2,15 +2,15 @@ apply plugin: 'com.android.application'
android {
compileSdkVersion 26
- buildToolsVersion "26.0.1"
+ buildToolsVersion "27.0.0"
defaultConfig {
vectorDrawables.useSupportLibrary = true
applicationId "gr.thmmy.mthmmy"
minSdkVersion 19
targetSdkVersion 26
- versionCode 10
- versionName "1.3.2"
+ versionCode 11
+ versionName "1.3.3"
archivesBaseName = "mTHMMY-v$versionName"
}
@@ -19,35 +19,38 @@ android {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
- /*debug {
- def date = new Date().format('ddMMyy_HH');
+ debug {
+ def date = new Date().format('ddMMyy_HHmmss')
archivesBaseName = archivesBaseName + "-$date"
- }*/
+ }
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
- compile 'com.android.support:appcompat-v7:26.0.0'
- compile 'com.android.support:design:26.0.0'
- compile 'com.android.support:support-v4:26.0.0'
- compile 'com.android.support:cardview-v7:26.0.0'
- compile 'com.android.support:recyclerview-v7:26.0.0'
- compile 'com.google.firebase:firebase-crash:10.2.6'
- compile 'com.squareup.okhttp3:okhttp:3.8.0'
+ compile 'com.android.support:appcompat-v7:26.1.0'
+ compile 'com.android.support:design:26.1.0'
+ compile 'com.android.support:support-v4:26.1.0'
+ compile 'com.android.support:cardview-v7:26.1.0'
+ compile 'com.android.support:recyclerview-v7:26.1.0'
+ compile 'com.google.firebase:firebase-crash:11.4.2'
+ compile 'com.squareup.okhttp3:okhttp:3.9.0'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.jakewharton.picasso:picasso2-okhttp3-downloader:1.1.0'
- compile 'org.jsoup:jsoup:1.10.2'
+ compile 'org.jsoup:jsoup:1.10.3'
compile 'com.github.franmontiel:PersistentCookieJar:v1.0.1'
compile 'com.github.PhilJay:MPAndroidChart:v3.0.2'
- compile('com.mikepenz:materialdrawer:5.9.2@aar') {
+ compile('com.mikepenz:materialdrawer:5.9.3@aar') {
transitive = true
}
compile 'com.mikepenz:fontawesome-typeface:4.7.0.0@aar'
+ compile 'com.mikepenz:google-material-typeface:3.0.1.2.original@aar'
compile 'pl.droidsonroids.gif:android-gif-drawable:1.2.7'
compile 'com.bignerdranch.android:expandablerecyclerview:3.0.0-RC1' //TODO: Deprecated - needs replacement!
- compile 'me.zhanghai.android.materialprogressbar:library:1.4.1'
+ compile 'me.zhanghai.android.materialprogressbar:library:1.4.2'
compile 'com.jakewharton.timber:timber:4.5.1'
}
-apply plugin: 'com.google.gms.google-services'
+if (getGradle().getStartParameter().getTaskRequests().toString().contains("Release")){
+ apply plugin: 'com.google.gms.google-services'
+}
diff --git a/app/src/debug/google-services.json b/app/src/debug/google-services.json
deleted file mode 100644
index c6718eaa..00000000
--- a/app/src/debug/google-services.json
+++ /dev/null
@@ -1,42 +0,0 @@
-{
- "project_info": {
- "project_number": "934432863001",
- "firebase_url": "https://mthmmy-debug.firebaseio.com",
- "project_id": "mthmmy-debug",
- "storage_bucket": "mthmmy-debug.appspot.com"
- },
- "client": [
- {
- "client_info": {
- "mobilesdk_app_id": "1:934432863001:android:088be0537ff6b292",
- "android_client_info": {
- "package_name": "gr.thmmy.mthmmy"
- }
- },
- "oauth_client": [
- {
- "client_id": "934432863001-d5oocs1vdi0pcepesi55a41p7enphfcv.apps.googleusercontent.com",
- "client_type": 3
- }
- ],
- "api_key": [
- {
- "current_key": "AIzaSyD4-gwVcb2Rc8zeT8l1v2Lg1DU0QgfGtk8"
- }
- ],
- "services": {
- "analytics_service": {
- "status": 1
- },
- "appinvite_service": {
- "status": 1,
- "other_platform_oauth_client": []
- },
- "ads_service": {
- "status": 2
- }
- }
- }
- ],
- "configuration_version": "1"
-}
\ No newline at end of file
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index 0ed23714..118026f0 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -7,6 +7,7 @@
-
diff --git a/app/src/main/assets/mit_libraries.html b/app/src/main/assets/mit_libraries.html
index 42b46e78..c0fa7697 100644
--- a/app/src/main/assets/mit_libraries.html
+++ b/app/src/main/assets/mit_libraries.html
@@ -39,7 +39,7 @@
OkHttp v3.8.0 (Copyright ©2016 Square, Inc.)
- Picasso v2.5.2 (Copyright ©2013 Square, Inc.)
- PersistentCookieJar v1.0.1 (Copyright ©2016 Francisco José Montiel Navarro)
- MPAndroidChart v3.0.2 (Copyright ©2016 Philipp Jahoda)
- MaterialDrawer v5.9.2 (Copyright ©2016 Mike Penz)
- Fontawesome Typeface Library v4.7.0.0 (Copyright ©2016 Mike Penz)
- MaterialProgressBar v1.4.1 (Copyright ©2015 Zhang Hai)
- OkHttp v3.9.0 (Copyright ©2016 Square, Inc.)
+ Picasso v2.5.2 (Copyright ©2013 Square, Inc.)
+ PersistentCookieJar v1.0.1 (Copyright ©2016 Francisco José Montiel Navarro)
+ MPAndroidChart v3.0.2 (Copyright ©2016 Philipp Jahoda)
+ MaterialDrawer v5.9.3 (Copyright ©2016 Mike Penz)
+ Android-Iconics v2.9.5 (Copyright ©2016 Mike Penz)
+ MaterialProgressBar v1.4.2 (Copyright ©2015 Zhang Hai)
+
jsoup v1.10.2 (Copyright ©2009-2017, Jonathan Hedley <jonathan@hedley.net>)
+ jsoup v1.10.3 (Copyright ©2009-2017, Jonathan Hedley <jonathan@hedley.net>)
android-gif-drawable v1.2.7 (Copyright ©2016 Karol Wrótniak, Droids on Roids)
diff --git a/app/src/main/java/gr/thmmy/mthmmy/activities/AboutActivity.java b/app/src/main/java/gr/thmmy/mthmmy/activities/AboutActivity.java
index 3f23909b..896a5fb5 100644
--- a/app/src/main/java/gr/thmmy/mthmmy/activities/AboutActivity.java
+++ b/app/src/main/java/gr/thmmy/mthmmy/activities/AboutActivity.java
@@ -53,28 +53,33 @@ public class AboutActivity extends BaseActivity {
trollGif = findViewById(R.id.trollPicFrame);
TextView tv = findViewById(R.id.version);
- if (tv != null)
- tv.setText(getString(R.string.version, versionName));
-
- tv.setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View view) {
- if (mVersionLastPressedTime + TIME_INTERVAL > System.currentTimeMillis()) {
- if (mVersionPressedCounter == TIMES_TO_PRESS) {
- appBar.setVisibility(View.INVISIBLE);
- mainContent.setVisibility(View.INVISIBLE);
- trollGif.setVisibility(View.VISIBLE);
- drawer.getDrawerLayout().setDrawerLockMode(DrawerLayout.LOCK_MODE_LOCKED_CLOSED);
- setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
+ if (tv != null) {
+ if (BuildConfig.DEBUG)
+ tv.setText(getString(R.string.version, versionName + "-debug"));
+ else
+ tv.setText(getString(R.string.version, versionName));
+
+
+ tv.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View view) {
+ if (mVersionLastPressedTime + TIME_INTERVAL > System.currentTimeMillis()) {
+ if (mVersionPressedCounter == TIMES_TO_PRESS) {
+ appBar.setVisibility(View.INVISIBLE);
+ mainContent.setVisibility(View.INVISIBLE);
+ trollGif.setVisibility(View.VISIBLE);
+ drawer.getDrawerLayout().setDrawerLockMode(DrawerLayout.LOCK_MODE_LOCKED_CLOSED);
+ setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
+ }
+ mVersionLastPressedTime = System.currentTimeMillis();
+ ++mVersionPressedCounter;
+ } else {
+ mVersionLastPressedTime = System.currentTimeMillis();
+ mVersionPressedCounter = 0;
}
- mVersionLastPressedTime = System.currentTimeMillis();
- ++mVersionPressedCounter;
- } else {
- mVersionLastPressedTime = System.currentTimeMillis();
- mVersionPressedCounter = 0;
}
- }
- });
+ });
+ }
}
@@ -95,7 +100,8 @@ public class AboutActivity extends BaseActivity {
.setView(webView)
.setPositiveButton(android.R.string.ok, null)
.show();
- alertDialog.getWindow().setLayout(width, height);
+ if(alertDialog.getWindow()!=null)
+ alertDialog.getWindow().setLayout(width, height);
}
public void displayMITLibraries(View v) {
@@ -109,7 +115,8 @@ public class AboutActivity extends BaseActivity {
.setView(webView)
.setPositiveButton(android.R.string.ok, null)
.show();
- alertDialog.getWindow().setLayout(width, height);
+ if(alertDialog.getWindow()!=null)
+ alertDialog.getWindow().setLayout(width, height);
}
}
diff --git a/app/src/main/java/gr/thmmy/mthmmy/activities/main/forum/ForumFragment.java b/app/src/main/java/gr/thmmy/mthmmy/activities/main/forum/ForumFragment.java
index 4adb199e..dcd9ab3c 100644
--- a/app/src/main/java/gr/thmmy/mthmmy/activities/main/forum/ForumFragment.java
+++ b/app/src/main/java/gr/thmmy/mthmmy/activities/main/forum/ForumFragment.java
@@ -125,7 +125,7 @@ public class ForumFragment extends BaseFragment {
});
CustomRecyclerView recyclerView = rootView.findViewById(R.id.list);
- LinearLayoutManager linearLayoutManager = new LinearLayoutManager(rootView.findViewById(R.id.list).getContext());
+ LinearLayoutManager linearLayoutManager = new LinearLayoutManager(recyclerView.getContext());
recyclerView.setLayoutManager(linearLayoutManager);
DividerItemDecoration dividerItemDecoration = new DividerItemDecoration(recyclerView.getContext(),
linearLayoutManager.getOrientation());
@@ -133,6 +133,8 @@ public class ForumFragment extends BaseFragment {
recyclerView.setAdapter(forumAdapter);
swipeRefreshLayout = rootView.findViewById(R.id.swiperefresh);
+ swipeRefreshLayout.setProgressBackgroundColorSchemeResource(R.color.primary);
+ swipeRefreshLayout.setColorSchemeResources(R.color.accent);
swipeRefreshLayout.setOnRefreshListener(
new SwipeRefreshLayout.OnRefreshListener() {
@Override
diff --git a/app/src/main/java/gr/thmmy/mthmmy/activities/main/recent/RecentAdapter.java b/app/src/main/java/gr/thmmy/mthmmy/activities/main/recent/RecentAdapter.java
index 15b9bc36..de128cb1 100644
--- a/app/src/main/java/gr/thmmy/mthmmy/activities/main/recent/RecentAdapter.java
+++ b/app/src/main/java/gr/thmmy/mthmmy/activities/main/recent/RecentAdapter.java
@@ -43,7 +43,7 @@ class RecentAdapter extends RecyclerView.Adapter
"));
dateTime = dateTime.replace("", "");
dateTime = dateTime.replace("", "");
+ dateTime = dateTime.replaceAll(":[0-5][0-9] ", " ");
+ if (!dateTime.contains(",")) {
+ dateTime = dateTime.replaceAll(".+? ([0-9])", "$1");
+ }
topicSummaries.add(new TopicSummary(link, title, lastUser, dateTime));
}
diff --git a/app/src/main/java/gr/thmmy/mthmmy/activities/profile/ProfileActivity.java b/app/src/main/java/gr/thmmy/mthmmy/activities/profile/ProfileActivity.java
index 24600df5..a83fc610 100644
--- a/app/src/main/java/gr/thmmy/mthmmy/activities/profile/ProfileActivity.java
+++ b/app/src/main/java/gr/thmmy/mthmmy/activities/profile/ProfileActivity.java
@@ -172,7 +172,7 @@ public class ProfileActivity extends BaseActivity implements LatestPostsFragment
ThmmyPage.PageCategory target = ThmmyPage.resolvePageCategory(Uri.parse(profileUrl));
if (!target.is(ThmmyPage.PageCategory.PROFILE)) {
- Timber.e("Bundle came with a non profile url!\nUrl:\n%s" , profileUrl);
+ Timber.e("Bundle came with a non profile url!\nUrl:\n%s", profileUrl);
Toast.makeText(this, "An error has occurred\n Aborting.", Toast.LENGTH_SHORT).show();
finish();
}
@@ -217,6 +217,7 @@ public class ProfileActivity extends BaseActivity implements LatestPostsFragment
//Class variables
Document profilePage;
Spannable usernameSpan;
+ Boolean isOnline = false;
protected void onPreExecute() {
progressBar.setVisibility(ProgressBar.VISIBLE);
@@ -261,13 +262,17 @@ public class ProfileActivity extends BaseActivity implements LatestPostsFragment
Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
usernameSpan.setSpan(new RelativeSizeSpan(0.45f)
, 0, 2, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
+
if (contentsTable.toString().contains("Online")
|| contentsTable.toString().contains("Συνδεδεμένος")) {
- usernameSpan.setSpan(new ForegroundColorSpan(Color.parseColor("#4CAF50"))
- , 0, 2, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
- } else
- usernameSpan.setSpan(new ForegroundColorSpan(Color.GRAY)
- , 0, 2, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
+ isOnline = true;
+ } else {
+ isOnline = false;
+ /*usernameSpan.setSpan(new ForegroundColorSpan(Color.GRAY)
+ , 0, 3, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);*/
+ }
+ usernameSpan.setSpan(new ForegroundColorSpan(Color.parseColor("#26A69A"))
+ , 2, usernameSpan.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
}
return true;
} catch (SSLHandshakeException e) {
@@ -290,8 +295,14 @@ public class ProfileActivity extends BaseActivity implements LatestPostsFragment
if (pmFAB.getVisibility() != View.GONE) pmFAB.setEnabled(true);
progressBar.setVisibility(ProgressBar.INVISIBLE);
- if (usernameSpan != null) usernameView.setText(usernameSpan);
- else if (usernameView.getText() != username) usernameView.setText(username);
+ if (usernameSpan != null) {
+ if (isOnline) {
+ usernameView.setTextColor(Color.parseColor("#4CAF50"));
+ } else {
+ usernameView.setTextColor(Color.GRAY);
+ }
+ usernameView.setText(usernameSpan);
+ } else if (usernameView.getText() != username) usernameView.setText(username);
if (thumbnailUrl != null && !Objects.equals(thumbnailUrl, ""))
//noinspection ConstantConditions
Picasso.with(getApplicationContext())
diff --git a/app/src/main/java/gr/thmmy/mthmmy/activities/profile/latestPosts/LatestPostsAdapter.java b/app/src/main/java/gr/thmmy/mthmmy/activities/profile/latestPosts/LatestPostsAdapter.java
index 9a2696ac..b7162495 100644
--- a/app/src/main/java/gr/thmmy/mthmmy/activities/profile/latestPosts/LatestPostsAdapter.java
+++ b/app/src/main/java/gr/thmmy/mthmmy/activities/profile/latestPosts/LatestPostsAdapter.java
@@ -21,6 +21,7 @@ import me.zhanghai.android.materialprogressbar.MaterialProgressBar;
* specified {@link LatestPostsFragment.LatestPostsFragmentInteractionListener}.
*/
class LatestPostsAdapter extends RecyclerView.Adapter