mirror of
https://github.com/leanote/leanote-android.git
synced 2025-10-14 14:10:56 +00:00
add github url
This commit is contained in:
@@ -15,6 +15,7 @@ import org.houxg.leamonax.R;
|
||||
import org.houxg.leamonax.database.AppDataBase;
|
||||
import org.houxg.leamonax.model.Note;
|
||||
import org.houxg.leamonax.service.AccountService;
|
||||
import org.houxg.leamonax.utils.OpenUtils;
|
||||
import org.houxg.leamonax.utils.TestUtils;
|
||||
|
||||
import java.security.SecureRandom;
|
||||
@@ -77,5 +78,9 @@ public class AboutActivity extends BaseActivity {
|
||||
.subscribe();
|
||||
}
|
||||
|
||||
@OnClick(R.id.ll_github)
|
||||
void clickedGithub() {
|
||||
OpenUtils.openUrl(this, "https://github.com/houxg/Leamonax");
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -2,7 +2,6 @@ package org.houxg.leamonax.ui;
|
||||
|
||||
|
||||
import android.content.Intent;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.support.annotation.Nullable;
|
||||
import android.text.Editable;
|
||||
@@ -20,6 +19,7 @@ import org.houxg.leamonax.model.BaseResponse;
|
||||
import org.houxg.leamonax.network.ApiProvider;
|
||||
import org.houxg.leamonax.network.LeaFailure;
|
||||
import org.houxg.leamonax.service.AccountService;
|
||||
import org.houxg.leamonax.utils.OpenUtils;
|
||||
import org.houxg.leamonax.utils.ToastUtils;
|
||||
|
||||
import java.util.Locale;
|
||||
@@ -119,13 +119,7 @@ public class SignInActivity extends BaseActivity implements TextWatcher {
|
||||
@OnClick(R.id.tv_forgot_password)
|
||||
void clickedForgotPassword() {
|
||||
String url = getHost() + FIND_PASSWORD;
|
||||
Intent i = new Intent(Intent.ACTION_VIEW);
|
||||
i.setData(Uri.parse(url));
|
||||
try {
|
||||
startActivity(i);
|
||||
} catch (Exception ex) {
|
||||
ToastUtils.show(this, R.string.host_address_is_incorrect);
|
||||
}
|
||||
OpenUtils.openUrl(this, url);
|
||||
}
|
||||
|
||||
@OnClick(R.id.tv_custom_host)
|
||||
|
19
app/src/main/java/org/houxg/leamonax/utils/OpenUtils.java
Normal file
19
app/src/main/java/org/houxg/leamonax/utils/OpenUtils.java
Normal file
@@ -0,0 +1,19 @@
|
||||
package org.houxg.leamonax.utils;
|
||||
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.net.Uri;
|
||||
|
||||
public class OpenUtils {
|
||||
|
||||
public static void openUrl(Context context, String url) {
|
||||
Intent i = new Intent(Intent.ACTION_VIEW);
|
||||
i.setData(Uri.parse(url));
|
||||
try {
|
||||
context.startActivity(i);
|
||||
} catch (Exception ex) {
|
||||
ToastUtils.show(context, "Can't open this url");
|
||||
}
|
||||
}
|
||||
}
|
@@ -105,6 +105,21 @@
|
||||
|
||||
<include layout="@layout/divider" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_github"
|
||||
style="@style/SettingsPanel"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
style="@style/SettingsSecondaryText"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Github" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<include layout="@layout/divider" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_debug"
|
||||
android:layout_width="match_parent"
|
||||
|
Reference in New Issue
Block a user