Skip to content

Commit

Permalink
corrected typos, non working links and credits
Browse files Browse the repository at this point in the history
  • Loading branch information
cyb3rko committed Jul 9, 2020
1 parent cc01887 commit 6539770
Show file tree
Hide file tree
Showing 9 changed files with 172 additions and 20 deletions.
30 changes: 30 additions & 0 deletions .idea/jarRepositories.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apply plugin: 'com.google.gms.google-services'

android {
compileSdkVersion 29
buildToolsVersion "29.0.1"
buildToolsVersion "29.0.2"
defaultConfig {
applicationId "com.thegreek.niko.logviewer_for_openHAB"
minSdkVersion 23
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@
package com.thegreek.niko.logviewer_for_openHAB;

import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.text.SpannableString;
import android.text.Spanned;
import android.text.method.LinkMovementMethod;
import android.text.style.ClickableSpan;
import android.view.View;
import android.widget.TextView;

import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;

public class Credits extends AppCompatActivity {
Expand All @@ -10,5 +19,51 @@ public class Credits extends AppCompatActivity {
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_credits);

TextView textView1 = findViewById(R.id.credits1);
TextView textView2 = findViewById(R.id.credits2);
TextView textView3 = findViewById(R.id.credits3);
TextView textView4 = findViewById(R.id.credits4);
TextView textView5 = findViewById(R.id.credits5);
TextView textView6 = findViewById(R.id.credits6);
TextView textView7 = findViewById(R.id.credits7);
TextView textView8 = findViewById(R.id.credits8);
TextView textView9 = findViewById(R.id.credits9);
TextView textView11 = findViewById(R.id.credits11);
TextView textView12 = findViewById(R.id.credits12);
TextView textView13 = findViewById(R.id.credits13);
TextView textView14 = findViewById(R.id.credits14);
TextView textView15 = findViewById(R.id.credits15);
TextView textView16 = findViewById(R.id.credits16);

setSpans(textView1, getString(R.string.credits1), "https://nikothegreek.jimdofree.com", 28, 38);
setSpans(textView2, getString(R.string.credits2), "https://developer.android.com/studio", 5, 0);
setSpans(textView3, getString(R.string.credits3), "https://nikothegreek.jimdofree.com", 33, 43);
setSpans(textView4, getString(R.string.credits4), "https://gimp.org", 5, 0);
setSpans(textView5, getString(R.string.credits5), "https://www.flaticon.com/authors/dave-gandy", 24, 34);
setSpans(textView6, getString(R.string.credits6), "https://www.flaticon.com/authors/smartline", 21, 30);
setSpans(textView7, getString(R.string.credits7), "https://www.flaticon.com/authors/freepik", 20, 27);
setSpans(textView8, getString(R.string.credits8), "https://www.flaticon.com/authors/those-icons", 20, 31);
setSpans(textView9, getString(R.string.credits9), "https://www.flaticon.com/authors/lyolya", 26, 32);
setSpans(textView11, getString(R.string.credits11), "https://github.com/AnderWeb/discreteSeekBar", 31, 40);
setSpans(textView12, getString(R.string.credits12), "https://apache.org/licenses/LICENSE-2.0", 20, 32);
setSpans(textView13, getString(R.string.credits13), "https://github.com/KeepSafe/TapTargetView", 29, 38);
setSpans(textView14, getString(R.string.credits14), "https://apache.org/licenses/LICENSE-2.0", 20, 32);
setSpans(textView15, getString(R.string.credits15), "https://github.com/GrenderG/Toasty", 22, 31);
setSpans(textView16, getString(R.string.credits16), "https://www.gnu.org/licenses/lgpl-3.0.html", 18, 30);
}

void setSpans(TextView textView, String string, final String link, int startChar, int endChar) {
ClickableSpan clickableSpan = new ClickableSpan() {
@Override
public void onClick(@NonNull View view) {
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(link)));
}
};

SpannableString spannableString = new SpannableString(string);
spannableString.setSpan(clickableSpan, startChar, endChar != 0 ? endChar : string.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
textView.setText(spannableString);
textView.setMovementMethod(LinkMovementMethod.getInstance());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
import com.androidnetworking.interfaces.StringRequestListener;
import com.google.firebase.analytics.FirebaseAnalytics;

import es.dmoral.toasty.Toasty;

public class MainActivity extends AppCompatActivity {

static FirebaseAnalytics firebaseAnalytics;
Expand All @@ -28,6 +30,7 @@ protected void onCreate(Bundle savedInstanceState) {
mySPR = this.getSharedPreferences("Speicherstand", 0);
editor = mySPR.edit();
editor.apply();
Toasty.Config.getInstance().allowQueue(false).apply();

getSupportFragmentManager().beginTransaction().replace(R.id.start, new MainFragment()).commit();

Expand Down
64 changes: 63 additions & 1 deletion app/src/main/res/layout/activity_credits.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
android:layout_marginStart="24dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="24dp"
android:autoLink="web"
android:linksClickable="true"
android:text="@string/credits2"
android:textColorLink="@color/colorAccent"
app:layout_constraintEnd_toEndOf="parent"
Expand Down Expand Up @@ -177,7 +179,7 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="24dp"
android:layout_marginTop="8dp"
android:layout_marginTop="0dp"
android:layout_marginEnd="24dp"
android:autoLink="web"
android:linksClickable="true"
Expand All @@ -187,4 +189,64 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/credits11" />

<TextView
android:id="@+id/credits13"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="24dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="24dp"
android:autoLink="web"
android:linksClickable="true"
android:text="@string/credits13"
android:textColorLink="@color/colorAccent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/credits12" />

<TextView
android:id="@+id/credits14"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="24dp"
android:layout_marginTop="0dp"
android:layout_marginEnd="24dp"
android:autoLink="web"
android:linksClickable="true"
android:text="@string/credits14"
android:textColorLink="@color/colorAccent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/credits13" />

<TextView
android:id="@+id/credits15"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="24dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="24dp"
android:autoLink="web"
android:linksClickable="true"
android:text="@string/credits15"
android:textColorLink="@color/colorAccent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/credits14" />

<TextView
android:id="@+id/credits16"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="24dp"
android:layout_marginTop="0dp"
android:layout_marginEnd="24dp"
android:autoLink="web"
android:linksClickable="true"
android:text="@string/credits16"
android:textColorLink="@color/colorAccent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/credits15" />

</androidx.constraintlayout.widget.ConstraintLayout>
2 changes: 1 addition & 1 deletion app/src/main/res/layout/fragment_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@

<TextView
android:id="@+id/endUserConsent"
android:layout_width="200dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="18dp"
android:layout_marginBottom="18dp"
Expand Down
30 changes: 16 additions & 14 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@
<string name="connecting">Connecting…</string>
<string name="auto_scroll1">Auto Scroll activated</string>
<string name="auto_scroll2">Auto Scroll deactivated</string>
<string name="text_size_changed">Text size changed to </string>
<string name="text_size_changed">Text size changed to&#160;</string>

<string name="end_user_consent_title">End User Consent</string>
<string name="end_user_consent_message">By using this app you agree to the Privacy Policy and the Terms of Use.</string>
<string name="end_user_consent_button1">Got it</string>
<string name="end_user_consent_button2">Cancel</string>

<string name="end_user_consent2_title">Your End User Consent</string>
<string name="end_user_consent2_message">By using this app you have agreed to the Privacy Policy and the Terms of Use.\n\n<u>Date:</u> </string>
<string name="end_user_consent2_message">By using this app you have agreed to the Privacy Policy and the Terms of Use.\n\n Date:&#160;</string>
<string name="end_user_consent2_message2">\n<u>Time:</u> </string>
<string name="end_user_consent2_button1">OK</string>

Expand All @@ -24,20 +24,22 @@
<string name="update_dialog_error">Missing permission, give it on next app start</string>

<string name="credits">Credits</string>
<string name="credits1">App made by _nikothegreek_ (nikothegreek.jimdofree.com)</string>
<string name="credits1">App made by _nikothegreek_ (my Website)</string>
<string name="credits2">with Android Studio</string>
<string name="credits3">App Icon made by _nikothegreek_ (nikothegreek.jimdofree.com)</string>
<string name="credits4">with Gimp (gimp.org) and appmaker.merq.org/tools</string>
<string name="credits5">"Eye Open icon" made by Dave Gandy from www.flaticon.com</string>
<string name="credits6">"Files icon" made by Smartline from www.flaticon.com</string>
<string name="credits7">"Lock icon" made by Freepik from www.flaticon.com</string>
<string name="credits8">"Font icon" made by Those Icons from www.flaticon.com</string>
<string name="credits9">"Left Arrow icon" made by Lyolya from www.flaticon.com</string>
<string name="credits3">App Icon made by _nikothegreek_ (my Website)</string>
<string name="credits4">with Gimp</string>
<string name="credits5">\"Eye Open icon\" made by Dave Gandy from flaticon.com</string>
<string name="credits6">\"Files icon\" made by Smartline from flaticon.com</string>
<string name="credits7">\"Lock icon\" made by Freepik from flaticon.com</string>
<string name="credits8">\"Font icon\" made by Those Icons from flaticon.com</string>
<string name="credits9">\"Left Arrow icon\" made by Lyolya from flaticon.com</string>
<string name="credits10">Libraries Used</string>
<string name="credits11">DiscreteSeekBar by AnderWeb (github.com/AnderWeb/discreteSeekBar)
\nApache 2.0 license (apache.org/licenses/LICENSE-2.0)</string>
<string name="credits12">TapTargetView by KeepSafe (github.com/KeepSafe/TapTargetView)
\nApache 2.0 license (apache.org/licenses/LICENSE-2.0)</string>
<string name="credits11">\"DiscreteSeekBar\" by AnderWeb (on GitHub)</string>
<string name="credits12">Apache 2.0 License (view License)</string>
<string name="credits13">\"TapTargetView\" by KeepSafe (on GitHub)</string>
<string name="credits14">Apache 2.0 License (view License)</string>
<string name="credits15">\"Toasty\" by GrenderG (on GitHub)</string>
<string name="credits16">LGPL 3.0 License (view License)</string>

<string name="hostname_ipaddress_view">Hostname / IP address</string>
<string name="hostname_ipaddress">(e.g. 192.168.178.10)</string>
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ buildscript {

}
dependencies {
classpath 'com.android.tools.build:gradle:3.6.3'
classpath 'com.android.tools.build:gradle:4.0.0'
classpath 'com.google.gms:google-services:4.3.3'

// NOTE: Do not place your application dependencies here; they belong
Expand Down
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Fri Apr 24 10:16:45 CEST 2020
#Wed Jun 17 16:15:31 CEST 2020
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip

0 comments on commit 6539770

Please sign in to comment.