kind) {
33 | T[] objs = text.getSpans(0, text.length(), kind);
34 | if (objs.length == 0) {
35 | return null;
36 | } else {
37 | for (int i = objs.length; i > 0; i--) {
38 | if (text.getSpanFlags(objs[i - 1]) == Spannable.SPAN_MARK_MARK) {
39 | return objs[i - 1];
40 | }
41 | }
42 | return null;
43 | }
44 | }
45 |
46 | class CodeTypefaceSpan extends TypefaceSpan {
47 |
48 | public CodeTypefaceSpan() {
49 | super("monospace");
50 | }
51 |
52 | @Override
53 | public void updateDrawState(TextPaint ds) {
54 | super.updateDrawState(ds);
55 | ds.setColor(Color.parseColor("#999999"));
56 | }
57 | }
58 | }
59 |
--------------------------------------------------------------------------------
/app/src/main/java/com/sneider/diycode/utils/html/UrlDrawable.java:
--------------------------------------------------------------------------------
1 | package com.sneider.diycode.utils.html;
2 |
3 | import android.graphics.Canvas;
4 | import android.graphics.ColorFilter;
5 | import android.graphics.PixelFormat;
6 | import android.graphics.drawable.BitmapDrawable;
7 | import android.graphics.drawable.Drawable;
8 |
9 | public class UrlDrawable extends BitmapDrawable implements Drawable.Callback {
10 |
11 | private Drawable mDrawable;
12 | private final String mSource;
13 |
14 | public UrlDrawable(String source) {
15 | mSource = source;
16 | }
17 |
18 | public String getSource() {
19 | return mSource;
20 | }
21 |
22 | @Override
23 | public void draw(Canvas canvas) {
24 | if (mDrawable != null) {
25 | mDrawable.draw(canvas);
26 | }
27 | }
28 |
29 | @Override
30 | public void setAlpha(int alpha) {
31 | if (mDrawable != null) {
32 | mDrawable.setAlpha(alpha);
33 | }
34 | }
35 |
36 | @Override
37 | public void setColorFilter(ColorFilter cf) {
38 | if (mDrawable != null) {
39 | mDrawable.setColorFilter(cf);
40 | }
41 | }
42 |
43 | @Override
44 | public int getOpacity() {
45 | if (mDrawable != null) {
46 | return mDrawable.getOpacity();
47 | }
48 | return PixelFormat.UNKNOWN;
49 | }
50 |
51 | public void setDrawable(Drawable drawable) {
52 | if (this.mDrawable != null) {
53 | this.mDrawable.setCallback(null);
54 | }
55 | drawable.setCallback(this);
56 | this.mDrawable = drawable;
57 | }
58 |
59 | @Override
60 | public void invalidateDrawable(Drawable who) {
61 | if (getCallback() != null) {
62 | getCallback().invalidateDrawable(who);
63 | }
64 | }
65 |
66 | @Override
67 | public void scheduleDrawable(Drawable who, Runnable what, long when) {
68 | if (getCallback() != null) {
69 | getCallback().scheduleDrawable(who, what, when);
70 | }
71 | }
72 |
73 | @Override
74 | public void unscheduleDrawable(Drawable who, Runnable what) {
75 | if (getCallback() != null) {
76 | getCallback().unscheduleDrawable(who, what);
77 | }
78 | }
79 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/sneider/diycode/utils/html/UrlDrawable1.java:
--------------------------------------------------------------------------------
1 | package com.sneider.diycode.utils.html;
2 |
3 | import android.graphics.Canvas;
4 | import android.graphics.ColorFilter;
5 | import android.graphics.PixelFormat;
6 | import android.graphics.drawable.Drawable;
7 |
8 | import com.bumptech.glide.load.resource.drawable.GlideDrawable;
9 |
10 | public class UrlDrawable1 extends Drawable implements Drawable.Callback {
11 |
12 | private GlideDrawable mDrawable;
13 |
14 | @Override public void draw(Canvas canvas) {
15 | if (mDrawable != null) {
16 | mDrawable.draw(canvas);
17 | }
18 | }
19 |
20 | @Override public void setAlpha(int alpha) {
21 | if (mDrawable != null) {
22 | mDrawable.setAlpha(alpha);
23 | }
24 | }
25 |
26 | @Override public void setColorFilter(ColorFilter cf) {
27 | if (mDrawable != null) {
28 | mDrawable.setColorFilter(cf);
29 | }
30 | }
31 |
32 | @Override public int getOpacity() {
33 | if (mDrawable != null) {
34 | return mDrawable.getOpacity();
35 | }
36 | return PixelFormat.UNKNOWN;
37 | }
38 |
39 | public void setDrawable(GlideDrawable drawable) {
40 | if (this.mDrawable != null) {
41 | this.mDrawable.setCallback(null);
42 | }
43 | drawable.setCallback(this);
44 | this.mDrawable = drawable;
45 | }
46 |
47 | @Override public void invalidateDrawable(Drawable who) {
48 | if (getCallback() != null) {
49 | getCallback().invalidateDrawable(who);
50 | }
51 | }
52 |
53 | @Override public void scheduleDrawable(Drawable who, Runnable what, long when) {
54 | if (getCallback() != null) {
55 | getCallback().scheduleDrawable(who, what, when);
56 | }
57 | }
58 |
59 | @Override public void unscheduleDrawable(Drawable who, Runnable what) {
60 | if (getCallback() != null) {
61 | getCallback().unscheduleDrawable(who, what);
62 | }
63 | }
64 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/sneider/diycode/widget/ScrollChildSwipeRefreshLayout.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016, The Android Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.sneider.diycode.widget;
18 |
19 | import android.content.Context;
20 | import android.support.v4.view.ViewCompat;
21 | import android.support.v4.widget.SwipeRefreshLayout;
22 | import android.util.AttributeSet;
23 | import android.view.View;
24 |
25 | /**
26 | * Extends {@link SwipeRefreshLayout} to support non-direct descendant scrolling views.
27 | *
28 | * {@link SwipeRefreshLayout} works as expected when a scroll view is a direct child: it triggers
29 | * the refresh only when the view is on top. This class adds a way (@link #setScrollUpChild} to
30 | * define which view controls this behavior.
31 | */
32 | public class ScrollChildSwipeRefreshLayout extends SwipeRefreshLayout {
33 |
34 | private View mScrollUpChild;
35 |
36 | public ScrollChildSwipeRefreshLayout(Context context) {
37 | super(context);
38 | }
39 |
40 | public ScrollChildSwipeRefreshLayout(Context context, AttributeSet attrs) {
41 | super(context, attrs);
42 | }
43 |
44 | @Override
45 | public boolean canChildScrollUp() {
46 | if (mScrollUpChild != null) {
47 | return ViewCompat.canScrollVertically(mScrollUpChild, -1);
48 | }
49 | return super.canChildScrollUp();
50 | }
51 |
52 | public void setScrollUpChild(View view) {
53 | mScrollUpChild = view;
54 | }
55 | }
56 |
--------------------------------------------------------------------------------
/app/src/main/java/com/sneider/diycode/widget/SettingRowView.java:
--------------------------------------------------------------------------------
1 | package com.sneider.diycode.widget;
2 |
3 | import android.content.Context;
4 | import android.content.res.TypedArray;
5 | import android.support.annotation.Nullable;
6 | import android.util.AttributeSet;
7 | import android.view.View;
8 | import android.widget.LinearLayout;
9 | import android.widget.TextView;
10 |
11 | import com.sneider.diycode.R;
12 |
13 | public class SettingRowView extends LinearLayout {
14 |
15 | private View mRootView;
16 | private TextView mSettingTitle;
17 | private TextView mSettingDescription;
18 |
19 | public SettingRowView(Context context) {
20 | this(context, null);
21 | }
22 |
23 | public SettingRowView(Context context, @Nullable AttributeSet attrs) {
24 | this(context, attrs, 0);
25 | }
26 |
27 | public SettingRowView(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
28 | super(context, attrs, defStyleAttr);
29 | mRootView = inflate(context, R.layout.view_setting_row, this);
30 | mSettingTitle = (TextView) findViewById(R.id.setting_title);
31 | mSettingDescription = (TextView) findViewById(R.id.setting_description);
32 | if (!isInEditMode()) {
33 | TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.RowView);
34 | String title = a.getString(R.styleable.RowView_rowTitle);
35 | String description = a.getString(R.styleable.RowView_rowDescription);
36 | mSettingTitle.setText(title);
37 | mSettingDescription.setText(description);
38 | a.recycle();
39 | }
40 | }
41 |
42 | public void setSettingTitle(String title) {
43 | mSettingTitle.setText(title);
44 | }
45 |
46 | public void setSettingDescription(String description) {
47 | mSettingDescription.setText(description);
48 | }
49 |
50 | @Override
51 | public void setEnabled(boolean enabled) {
52 | super.setEnabled(enabled);
53 | mRootView.setEnabled(enabled);
54 | if (enabled) {
55 | mSettingTitle.setTextColor(getResources().getColor(R.color.color_4d4d4d));
56 | mSettingDescription.setTextColor(getResources().getColor(R.color.color_999999));
57 | } else {
58 | int disabledTextColor = getResources().getColor(R.color.color_999999);
59 | mSettingTitle.setTextColor(disabledTextColor);
60 | mSettingDescription.setTextColor(disabledTextColor);
61 | }
62 | }
63 | }
64 |
--------------------------------------------------------------------------------
/app/src/main/java/com/sneider/diycode/widget/loadmore/LoadMoreListener.java:
--------------------------------------------------------------------------------
1 | package com.sneider.diycode.widget.loadmore;
2 |
3 | public interface LoadMoreListener {
4 |
5 | void onLoadMore();
6 | }
7 |
--------------------------------------------------------------------------------
/app/src/main/java/com/sneider/diycode/widget/tag/TagAdapter.java:
--------------------------------------------------------------------------------
1 | package com.sneider.diycode.widget.tag;
2 |
3 | import android.view.View;
4 |
5 | import com.sneider.diycode.widget.FlowLayout;
6 |
7 | import java.util.ArrayList;
8 | import java.util.Arrays;
9 | import java.util.HashSet;
10 | import java.util.List;
11 | import java.util.Set;
12 |
13 | public abstract class TagAdapter {
14 |
15 | private List mTagDatas;
16 | private OnDataChangedListener mOnDataChangedListener;
17 | private HashSet mCheckedPosList = new HashSet();
18 |
19 | public TagAdapter(List datas) {
20 | mTagDatas = datas;
21 | }
22 |
23 | public TagAdapter(T[] datas) {
24 | mTagDatas = new ArrayList(Arrays.asList(datas));
25 | }
26 |
27 | static interface OnDataChangedListener {
28 | void onChanged();
29 | }
30 |
31 | void setOnDataChangedListener(OnDataChangedListener listener) {
32 | mOnDataChangedListener = listener;
33 | }
34 |
35 | public void setSelectedList(int... pos) {
36 | for (int i = 0; i < pos.length; i++)
37 | mCheckedPosList.add(pos[i]);
38 | notifyDataChanged();
39 | }
40 |
41 | public void setSelectedList(Set set) {
42 | mCheckedPosList.clear();
43 | if (set != null)
44 | mCheckedPosList.addAll(set);
45 | notifyDataChanged();
46 | }
47 |
48 | HashSet getPreCheckedList() {
49 | return mCheckedPosList;
50 | }
51 |
52 | public int getCount() {
53 | return mTagDatas == null ? 0 : mTagDatas.size();
54 | }
55 |
56 | public void notifyDataChanged() {
57 | mOnDataChangedListener.onChanged();
58 | }
59 |
60 | public T getItem(int position) {
61 | return mTagDatas.get(position);
62 | }
63 |
64 | public abstract View getView(FlowLayout parent, int position, T t);
65 |
66 | public boolean setSelected(int position, T t) {
67 | return false;
68 | }
69 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/sneider/diycode/widget/tag/TagView.java:
--------------------------------------------------------------------------------
1 | package com.sneider.diycode.widget.tag;
2 |
3 | import android.content.Context;
4 | import android.view.View;
5 | import android.widget.Checkable;
6 | import android.widget.FrameLayout;
7 |
8 | /**
9 | * Created by zhy on 15/9/10.
10 | */
11 | public class TagView extends FrameLayout implements Checkable {
12 |
13 | private boolean isChecked;
14 | private static final int[] CHECK_STATE = new int[]{android.R.attr.state_checked};
15 |
16 | public TagView(Context context) {
17 | super(context);
18 | }
19 |
20 | public View getTagView() {
21 | return getChildAt(0);
22 | }
23 |
24 | @Override
25 | public int[] onCreateDrawableState(int extraSpace) {
26 | int[] states = super.onCreateDrawableState(extraSpace + 1);
27 | if (isChecked()) {
28 | mergeDrawableStates(states, CHECK_STATE);
29 | }
30 | return states;
31 | }
32 |
33 | /**
34 | * Change the checked state of the view
35 | *
36 | * @param checked The new checked state
37 | */
38 | @Override
39 | public void setChecked(boolean checked) {
40 | if (this.isChecked != checked) {
41 | this.isChecked = checked;
42 | refreshDrawableState();
43 | }
44 | }
45 |
46 | /**
47 | * @return The current checked state of the view
48 | */
49 | @Override
50 | public boolean isChecked() {
51 | return isChecked;
52 | }
53 |
54 | /**
55 | * Change the checked state of the view to the inverse of its current state
56 | */
57 | @Override
58 | public void toggle() {
59 | setChecked(!isChecked);
60 | }
61 | }
62 |
--------------------------------------------------------------------------------
/app/src/main/jniLibs/armeabi/liblbs.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/linsneider/DiyCodeAndroid/840e97c5d7bc1c48e1fe1bef0ebacc83467745a7/app/src/main/jniLibs/armeabi/liblbs.so
--------------------------------------------------------------------------------
/app/src/main/res/color/diycode_bottom_toolbar_apply.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
19 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v21/bg_recycler.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v21/recycler_rectangle.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/logo_big.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/linsneider/DiyCodeAndroid/840e97c5d7bc1c48e1fe1bef0ebacc83467745a7/app/src/main/res/drawable-xhdpi/logo_big.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/logo_small.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/linsneider/DiyCodeAndroid/840e97c5d7bc1c48e1fe1bef0ebacc83467745a7/app/src/main/res/drawable-xhdpi/logo_small.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/placeholder.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/linsneider/DiyCodeAndroid/840e97c5d7bc1c48e1fe1bef0ebacc83467745a7/app/src/main/res/drawable-xhdpi/placeholder.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/bg_follow.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/bg_node.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/bg_node_checked.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
13 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/bg_node_normal.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
13 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/bg_press.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | -
5 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/bg_progress_circle.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/bg_recycler.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | -
5 |
6 |
7 |
8 |
9 |
10 |
11 | -
12 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/bg_txt_node.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/bg_txt_section.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/divider.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_add.xml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
10 |
11 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_back.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_block.xml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_close.xml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_code.xml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_fab_reply.xml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_favorite.xml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_favorite_yes.xml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_filter.xml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_follower.xml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_following.xml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_github.xml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_help.xml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_image.xml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_like.xml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_like_yes.xml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_my_reply.xml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_notification.xml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_notification_red.xml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_pencil.xml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_reply.xml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_search.xml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_send.xml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
10 |
11 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_settings.xml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_share.xml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_sites.xml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_star.xml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_topic.xml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_wiki.xml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/progressbar.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | -
5 |
6 |
7 |
8 | -
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_detail.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
13 |
14 |
20 |
21 |
22 |
28 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_image.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
14 |
15 |
19 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_photo.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
14 |
15 |
20 |
21 |
29 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_sites.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
12 |
13 |
19 |
20 |
21 |
26 |
27 |
33 |
34 |
41 |
42 |
43 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_web.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
12 |
13 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/fragment_list.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
14 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/item_image.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/item_news_node.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/item_node.xml:
--------------------------------------------------------------------------------
1 |
2 |
10 |
11 |
18 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/item_reply_user.xml:
--------------------------------------------------------------------------------
1 |
2 |
10 |
11 |
16 |
17 |
27 |
28 |
35 |
36 |
37 |
44 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/item_section.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
17 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/item_sites.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
14 |
15 |
20 |
21 |
22 |
26 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/item_sitesbean.xml:
--------------------------------------------------------------------------------
1 |
2 |
10 |
11 |
16 |
17 |
24 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/item_user.xml:
--------------------------------------------------------------------------------
1 |
2 |
11 |
12 |
17 |
18 |
24 |
25 |
31 |
32 |
37 |
38 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/layout_basic_web.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
13 |
14 |
19 |
20 |
26 |
27 |
36 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/layout_footer.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
13 |
14 |
21 |
22 |
23 |
30 |
31 |
35 |
36 |
37 |
44 |
45 |
49 |
50 |
57 |
58 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/layout_nav_header.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
16 |
17 |
25 |
26 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/popup_news_nodes.xml:
--------------------------------------------------------------------------------
1 |
2 |
10 |
11 |
16 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/popup_topic_nodes.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
13 |
14 |
19 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/view_setting_row.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
15 |
16 |
23 |
--------------------------------------------------------------------------------
/app/src/main/res/menu/menu_drawer.xml:
--------------------------------------------------------------------------------
1 |
2 |
50 |
--------------------------------------------------------------------------------
/app/src/main/res/menu/menu_popup_code_category.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/app/src/main/res/menu/menu_toolbar_add_activity.xml:
--------------------------------------------------------------------------------
1 |
2 |
11 |
--------------------------------------------------------------------------------
/app/src/main/res/menu/menu_toolbar_detail_activity.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
--------------------------------------------------------------------------------
/app/src/main/res/menu/menu_toolbar_image_activity.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
--------------------------------------------------------------------------------
/app/src/main/res/menu/menu_toolbar_list_activity.xml:
--------------------------------------------------------------------------------
1 |
2 |
11 |
--------------------------------------------------------------------------------
/app/src/main/res/menu/menu_toolbar_main_activity.xml:
--------------------------------------------------------------------------------
1 |
2 |
18 |
--------------------------------------------------------------------------------
/app/src/main/res/menu/menu_toolbar_notification_activity.xml:
--------------------------------------------------------------------------------
1 |
2 |
15 |
--------------------------------------------------------------------------------
/app/src/main/res/menu/menu_toolbar_web_activity.xml:
--------------------------------------------------------------------------------
1 |
2 |
21 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/linsneider/DiyCodeAndroid/840e97c5d7bc1c48e1fe1bef0ebacc83467745a7/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/linsneider/DiyCodeAndroid/840e97c5d7bc1c48e1fe1bef0ebacc83467745a7/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/linsneider/DiyCodeAndroid/840e97c5d7bc1c48e1fe1bef0ebacc83467745a7/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/linsneider/DiyCodeAndroid/840e97c5d7bc1c48e1fe1bef0ebacc83467745a7/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/linsneider/DiyCodeAndroid/840e97c5d7bc1c48e1fe1bef0ebacc83467745a7/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/values/arrays.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | - 删除
6 |
7 |
8 |
9 | - 收藏
10 |
11 |
12 |
13 | - 取消关注
14 |
15 |
16 |
17 | - 取消屏蔽
18 |
19 |
20 |
21 | - 取消收藏
22 |
23 |
--------------------------------------------------------------------------------
/app/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | @color/color_ffffff
4 | @color/color_ffffff
5 | @color/color_db3937
6 | #FFFFFF
7 | #000000
8 | #DB3937
9 | #E67473
10 |
11 | #F0F0F0
12 | #C8C8CE
13 | #999999
14 | #62646C
15 | #4D4D4D
16 |
17 |
--------------------------------------------------------------------------------
/app/src/main/res/values/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 16dp
5 |
6 |
7 | 2dp
8 | 4dp
9 | 8dp
10 | 12dp
11 | 16dp
12 | 24dp
13 |
14 | 56dp
15 |
16 |
--------------------------------------------------------------------------------
/app/src/main/res/xml/provider_paths.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
6 |
9 |
--------------------------------------------------------------------------------
/app/src/test/java/com/sneider/diycode/ExampleUnitTest.java:
--------------------------------------------------------------------------------
1 | package com.sneider.diycode;
2 |
3 | import org.junit.Test;
4 |
5 | import static org.junit.Assert.*;
6 |
7 | /**
8 | * Example local unit test, which will execute on the development machine (host).
9 | *
10 | * @see Testing documentation
11 | */
12 | public class ExampleUnitTest {
13 | @Test
14 | public void addition_isCorrect() throws Exception {
15 | assertEquals(4, 2 + 2);
16 | }
17 | }
--------------------------------------------------------------------------------
/build.gradle:
--------------------------------------------------------------------------------
1 | // Top-level build file where you can add configuration options common to all sub-projects/modules.
2 | apply from: "config.gradle"// 这里表示引用config.gradle文件
3 | buildscript {
4 | repositories {
5 | jcenter()
6 | }
7 | dependencies {
8 | classpath 'com.android.tools.build:gradle:2.3.3'
9 | // lambda
10 | classpath 'me.tatarka:gradle-retrolambda:3.6.1'
11 | // NOTE: Do not place your application dependencies here; they belong
12 | // in the individual module build.gradle files
13 | }
14 | }
15 |
16 | allprojects {
17 | repositories {
18 | jcenter()
19 | maven { url "https://jitpack.io" }
20 | maven { url "https://raw.githubusercontent.com/Pgyer/mvn_repo_pgyer/master" }
21 | }
22 | }
23 |
24 | task clean(type: Delete) {
25 | delete rootProject.buildDir
26 | }
27 |
--------------------------------------------------------------------------------
/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 |
3 | # IDE (e.g. Android Studio) users:
4 | # Gradle settings configured through the IDE *will override*
5 | # any settings specified in this file.
6 |
7 | # For more details on how to configure your build environment visit
8 | # http://www.gradle.org/docs/current/userguide/build_environment.html
9 |
10 | # Specifies the JVM arguments used for the daemon process.
11 | # The setting is particularly useful for tweaking memory settings.
12 | org.gradle.jvmargs=-Xmx1536m
13 |
14 | # When configured, Gradle will run in incubating parallel mode.
15 | # This option should only be used with decoupled projects. More details, visit
16 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
17 | # org.gradle.parallel=true
18 |
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/linsneider/DiyCodeAndroid/840e97c5d7bc1c48e1fe1bef0ebacc83467745a7/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Tue Mar 07 21:24:52 GMT+08:00 2017
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip
7 |
--------------------------------------------------------------------------------
/screenshots/1.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/linsneider/DiyCodeAndroid/840e97c5d7bc1c48e1fe1bef0ebacc83467745a7/screenshots/1.jpg
--------------------------------------------------------------------------------
/screenshots/2.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/linsneider/DiyCodeAndroid/840e97c5d7bc1c48e1fe1bef0ebacc83467745a7/screenshots/2.jpg
--------------------------------------------------------------------------------
/screenshots/3.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/linsneider/DiyCodeAndroid/840e97c5d7bc1c48e1fe1bef0ebacc83467745a7/screenshots/3.jpg
--------------------------------------------------------------------------------
/screenshots/4.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/linsneider/DiyCodeAndroid/840e97c5d7bc1c48e1fe1bef0ebacc83467745a7/screenshots/4.jpg
--------------------------------------------------------------------------------
/screenshots/5.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/linsneider/DiyCodeAndroid/840e97c5d7bc1c48e1fe1bef0ebacc83467745a7/screenshots/5.png
--------------------------------------------------------------------------------
/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app'
2 |
--------------------------------------------------------------------------------