Skip to content

Commit

Permalink
add image bed help
Browse files Browse the repository at this point in the history
  • Loading branch information
mzlogin committed Oct 16, 2021
1 parent 8adf9fb commit 851ace1
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package org.mazhuang.guanggoo.settings;

import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
Expand Down Expand Up @@ -63,7 +65,7 @@ public void onCommentsOrderDescChanged(CompoundButton button, boolean value) {
PrefsUtil.putBoolean(App.getInstance(), ConstantUtil.KEY_COMMENTS_ORDER_DESC, value);
}

@OnClick({R.id.img_bed_api_key})
@OnClick({R.id.img_bed_api_key, R.id.help_image_bed_api_key})
public void onClick(View v) {
switch (v.getId()) {
case R.id.img_bed_api_key: {
Expand All @@ -73,6 +75,11 @@ public void onClick(View v) {
mListener.openPage(ConstantUtil.SETTINGS_EDIT_URL, mImgBedLabelTextView.getText().toString(), bundle);
}
break;

case R.id.help_image_bed_api_key:
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(ConstantUtil.IMAGE_BED_HELP_URL)));
break;

default:
break;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,4 +69,5 @@ private ConstantUtil() {}

public static final String DOWNLOAD_URL_COOLAPK = "https://www.coolapk.com/apk/164523";
public static final String PRIVACY_URL = "https://mazhuang.org/guanggoo-android/policy";
public static final String IMAGE_BED_HELP_URL = "https://mazhuang.org/guanggoo-android/image-bed-help";
}
Binary file added app/src/main/res/drawable-xxhdpi/help_how.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 15 additions & 0 deletions app/src/main/res/layout/fragment_settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,19 @@
android:src="@drawable/right"/>
</LinearLayout>

<LinearLayout
style="@style/LinearClickableItem"
android:gravity="top"
android:layout_height="wrap_content">

<TextView
android:id="@+id/help_image_bed_api_key"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/help_image_bed_api_key"
android:textSize="@dimen/font_smallest"
android:textColor="@color/listBackground"
android:drawableLeft="@drawable/help_how" />
</LinearLayout>

</LinearLayout>
1 change: 1 addition & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@
<string name="privacy_and_policy">隐私与政策</string>
<string name="img_bed_api_key_label">图床 API KEY</string>
<string name="img_bed_api_key_hint">请输入 sm.ms 图床 api key</string>
<string name="help_image_bed_api_key">如何获取图床 API KEY</string>

<string-array name="home_tab_names">
<item>@string/default_order_topics</item>
Expand Down

0 comments on commit 851ace1

Please sign in to comment.