Skip to content

Commit bae096f

Browse files
committed
hoho, come on baby
1 parent 530066a commit bae096f

File tree

6 files changed

+14
-19
lines changed

6 files changed

+14
-19
lines changed

.idea/gradle.xml

+1-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/jarRepositories.xml

+5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/src/main/java/com/java/yandifei/network/MyApplication.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public void onCreate() {
2525
//new KnowledgeGraph.GetKnowledgeGraghListAsyncTask(list, "病毒", new KnowledgeGraph.PostExec() {
2626
// @Override
2727
// public void onPostExec(Boolean success) {
28-
// Log.d("mylog", "oh shit");
28+
// Log.d("mylog", "oh classes");
2929
// }
3030
//}).execute();
3131
}

app/src/main/java/com/java/yandifei/network/NewsEntry.java

+6-8
Original file line numberDiff line numberDiff line change
@@ -131,17 +131,15 @@ public static void getNewsList(CharSequence tag, int page, int entryNumPerPage,
131131
} catch (UnknownHostException e) {
132132
// no network access
133133
if (newsList.size() == 0) {
134-
getAllSavedNews(newsList);
134+
List<NewsEntry> allSavedNews = new ArrayList<NewsEntry>();
135+
getAllSavedNews(allSavedNews);
136+
for (NewsEntry entry : allSavedNews) {
137+
if (entry.type.equals(tag) || tag.equals("all"))
138+
newsList.add(entry);
139+
}
135140
newsList.sort(new Comparator<NewsEntry>() {
136141
@Override
137142
public int compare(NewsEntry o1, NewsEntry o2) {
138-
//String[] times1 = o1.time.split(" ");
139-
//String[] times2 = o2.time.split(" ");
140-
//if (times1.length == 1 || times2.length == 1) {
141-
// return times2[0].replace("/", "-").compareTo(
142-
// times1[0].replace("/", "-"));
143-
//}
144-
//return o2.time.compareTo(o1.time);
145143
String time1 = o1.time.replace("/", "-");
146144
String time2 = o2.time.replace("/", "-");
147145
return time2.compareTo(time1);

app/src/main/java/com/java/yandifei/ui/newscluster/NewsClusterListFragment.java

+1-6
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,24 @@
11
package com.java.yandifei.ui.newscluster;
22

3-
import android.os.AsyncTask;
43
import android.content.Intent;
54
import android.os.Bundle;
65
import android.util.Log;
76
import android.view.LayoutInflater;
87
import android.view.View;
98
import android.view.ViewGroup;
10-
import android.widget.Toast;
119

1210
import androidx.annotation.NonNull;
1311
import androidx.fragment.app.Fragment;
14-
import androidx.fragment.app.FragmentTransaction;
1512
import androidx.recyclerview.widget.GridLayoutManager;
1613
import androidx.recyclerview.widget.RecyclerView;
1714

1815
import com.alibaba.fastjson.JSON;
1916
import com.alibaba.fastjson.JSONArray;
20-
import com.alibaba.fastjson.JSONObject;
2117
import com.java.yandifei.R;
2218
import com.java.yandifei.network.NewsEntry;
2319
import com.java.yandifei.ui.news.NewsContentActivity;
2420
import com.scwang.smart.refresh.layout.api.RefreshLayout;
2521
import com.scwang.smart.refresh.layout.listener.OnLoadMoreListener;
26-
import com.scwang.smart.refresh.layout.listener.OnRefreshListener;
2722

2823
import java.io.InputStream;
2924
import java.util.ArrayList;
@@ -46,7 +41,7 @@ public View onCreateView(@NonNull final LayoutInflater inflater,
4641
this.newsList = new ArrayList<>();
4742

4843
// get data from json
49-
InputStream data = getResources().openRawResource(R.raw.shit);
44+
InputStream data = getResources().openRawResource(R.raw.classes);
5045
try {
5146
JSONArray dataArray = JSON.parseObject(data, JSONArray.class);
5247
for (int i = 0; i < dataArray.size(); ++i) {
File renamed without changes.

0 commit comments

Comments
 (0)