diff --git a/.gitignore b/.gitignore
index aa724b77071afcbd9bb398053e05adaf7ac9405a..f7415cfd67ed9cb0c3cc8bc1dee9d97f77694c19 100644
--- a/.gitignore
+++ b/.gitignore
@@ -12,4 +12,4 @@
/captures
.externalNativeBuild
.cxx
-local.properties
+local.properties
\ No newline at end of file
diff --git a/.idea/.gitignore b/.idea/.gitignore
deleted file mode 100644
index 26d33521af10bcc7fd8cea344038eaaeb78d0ef5..0000000000000000000000000000000000000000
--- a/.idea/.gitignore
+++ /dev/null
@@ -1,3 +0,0 @@
-# Default ignored files
-/shelf/
-/workspace.xml
diff --git a/.idea/.name b/.idea/.name
index 110b9a7aa544baf8b97a544c0f7e3fa00dfac8f0..e05793d47568df13f4a5fa9ee1d84351cf1f0027 100644
--- a/.idea/.name
+++ b/.idea/.name
@@ -1 +1 @@
-android-mvvm-basic-framework
\ No newline at end of file
+FinanceLake
\ No newline at end of file
diff --git a/.idea/jarRepositories.xml b/.idea/jarRepositories.xml
index 1d883accb26f7bf4be154955aecccd939fa3dcd3..5f9fab9c081a690635227cb66cffa5e2a0ac2c0e 100644
--- a/.idea/jarRepositories.xml
+++ b/.idea/jarRepositories.xml
@@ -11,11 +11,6 @@
-
-
-
-
-
@@ -26,5 +21,15 @@
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/misc.xml b/.idea/misc.xml
index 33782299c2629f7f8a4f78d0df1fb55fac489361..58918f50335428f2efb3af4d621f9f405ed659d4 100644
--- a/.idea/misc.xml
+++ b/.idea/misc.xml
@@ -1,14 +1,4 @@
-
-
-
-
-
-
-
-
-
-
-
+
\ No newline at end of file
diff --git a/README.md b/README.md
index e1652ae2b884ca830ed0c8e63931ae9730f3e02b..88c3aaa5346ef99638de02b68f92d3c507fe4697 100644
--- a/README.md
+++ b/README.md
@@ -4,14 +4,43 @@
金融江湖,灯塔
#### 软件架构
-软件架构说明
+- 政策,基本面,行业景气度,技术面,近期热点,盈利情况
+- 用户评论情感分析(需要增加用户评论)
+- 股票资讯(新闻)情感分析
+- 查询资讯,年报,下载pdf
+- 股票知识(https://stock.gucheng.com/202103/4026155.shtml)
+- 问答 资讯 研报
+- 抓取研报数据,国家统计局最新新闻,股票资讯,分析每年各个节日上涨行业看大资金布局哪些板块跟着喝汤
+- 收费研报
+- 股票热度
+- 概况
+#### 首页
+- 资讯
+- 研报
-#### 安装教程
+#### 选股
+- 选股功能
+- 自选
-1. xxxx
-2. xxxx
-3. xxxx
+#### 社区
+- 精华帖
+- 股票技巧
+
+#### 我的
+- 收藏关注,跟随者
+- 我的发布
+- 消息提醒
+- 发布帖子
+
+
+
+#### 想法
+- 抓取每日成交量
+- 分析红十字星形态,准备起飞
+- 获取最热板块分类并排名(强势板块看板块指数)
+- 抓取研报信息,获取股票信息
+- 查看公司的基本面盈利情况
#### 使用说明
diff --git a/app/build.gradle b/app/build.gradle
index a8a96ecea07454fa5cb05b2475234602a8a1d886..d073edf08e31f5e9a09a2434d0e9bc57d6605f24 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -8,7 +8,7 @@ android {
buildToolsVersion "30.0.3"
defaultConfig {
- applicationId "com.sky.android_mvvm_basic_framework"
+ applicationId 'com.sky.financelake'
minSdkVersion 21
targetSdkVersion 30
versionCode 1
@@ -33,12 +33,19 @@ android {
dependencies {
- implementation 'androidx.appcompat:appcompat:1.2.0'
- implementation 'com.google.android.material:material:1.3.0'
- implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
+ implementation 'androidx.appcompat:appcompat:1.3.1'
+ implementation 'com.google.android.material:material:1.4.0'
+ implementation 'androidx.constraintlayout:constraintlayout:2.1.0'
+ implementation 'androidx.navigation:navigation-fragment:2.3.5'
+ implementation 'androidx.navigation:navigation-ui:2.3.5'
+ implementation 'androidx.legacy:legacy-support-v4:1.0.0'
+ implementation 'androidx.recyclerview:recyclerview:1.2.1'
+ implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.3.1'
+ implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.3.1'
testImplementation 'junit:junit:4.13.2'
- androidTestImplementation 'androidx.test.ext:junit:1.1.1'
- androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
+ androidTestImplementation 'androidx.test.ext:junit:1.1.3'
+ androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
+
//依赖注入
implementation "com.google.dagger:hilt-android:$hilt_version"
@@ -50,9 +57,24 @@ dependencies {
//网络请求
implementation 'com.squareup.retrofit2:retrofit:2.9.0'
implementation 'com.squareup.retrofit2:converter-gson:2.9.0'
- implementation 'com.google.code.gson:gson:2.8.5'
- implementation 'com.squareup.okio:okio:2.2.2'
- implementation 'com.squareup.okhttp3:okhttp:3.14.1'
+ implementation 'com.squareup.okhttp3:logging-interceptor:4.9.0'
+ implementation 'com.google.code.gson:gson:2.8.6'
+ implementation 'com.squareup.okio:okio:2.8.0'
+ implementation 'com.squareup.okhttp3:okhttp:4.9.0'
+
+ //图片加载
+ implementation 'com.github.bumptech.glide:glide:4.12.0'
+ annotationProcessor 'com.github.bumptech.glide:compiler:4.12.0'
+
+ //微光
+ implementation 'com.facebook.shimmer:shimmer:0.5.0'
+
+ //pdf
+ implementation 'com.github.barteksc:android-pdf-viewer:3.2.0-beta.1'
+
//K线
implementation 'com.wordplat:ikvStockChart:0.1.5'
+
+ //富文本显示
+ implementation 'com.github.limedroid:XRichText:v1.0.0'
}
\ No newline at end of file
diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro
index 481bb434814107eb79d7a30b676d344b0df2f8ce..a5370e093b8a43212d036e01bbb7f5204b4b0e98 100644
--- a/app/proguard-rules.pro
+++ b/app/proguard-rules.pro
@@ -18,4 +18,5 @@
# If you keep the line number information, uncomment this to
# hide the original source file name.
-#-renamesourcefileattribute SourceFile
\ No newline at end of file
+#-renamesourcefileattribute SourceFile
+-keep class com.shockwave.**
\ No newline at end of file
diff --git a/app/src/androidTest/java/com/sky/android_mvvm_basic_framework/ExampleInstrumentedTest.java b/app/src/androidTest/java/com/sky/financelake/ExampleInstrumentedTest.java
similarity index 82%
rename from app/src/androidTest/java/com/sky/android_mvvm_basic_framework/ExampleInstrumentedTest.java
rename to app/src/androidTest/java/com/sky/financelake/ExampleInstrumentedTest.java
index 6d64dc28cac289d04261024e45b4aa228e72d947..5a1c18df884c92ae4acfeb52c678f6da177de3be 100644
--- a/app/src/androidTest/java/com/sky/android_mvvm_basic_framework/ExampleInstrumentedTest.java
+++ b/app/src/androidTest/java/com/sky/financelake/ExampleInstrumentedTest.java
@@ -1,4 +1,4 @@
-package com.sky.android_mvvm_basic_framework;
+package com.sky.financelake;
import android.content.Context;
@@ -21,6 +21,6 @@ public class ExampleInstrumentedTest {
public void useAppContext() {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
- assertEquals("com.sky.android_mvvm_basic_framework", appContext.getPackageName());
+ assertEquals("com.sky.financelake", appContext.getPackageName());
}
}
\ No newline at end of file
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index f44cde457d99cf51d56e403f0e3537060967fc05..2fb18b4d90bfa0e9009ed7c41467f2f04476effb 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -1,33 +1,51 @@
+ package="com.sky.financelake">
-
+
+
+
+
+
-
+
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/java/com/sky/android_mvvm_basic_framework/MainActivity.java b/app/src/main/java/com/sky/android_mvvm_basic_framework/MainActivity.java
deleted file mode 100644
index 9e5f3757fc3d2d1d7ce79dd58f72127300a068b1..0000000000000000000000000000000000000000
--- a/app/src/main/java/com/sky/android_mvvm_basic_framework/MainActivity.java
+++ /dev/null
@@ -1,23 +0,0 @@
-package com.sky.android_mvvm_basic_framework;
-
-import android.content.Intent;
-import android.os.Bundle;
-import android.util.Log;
-
-import com.sky.android_mvvm_basic_framework.base.BaseActivity;
-import com.sky.android_mvvm_basic_framework.ui.StockA;
-
-import dagger.hilt.android.AndroidEntryPoint;
-
-@AndroidEntryPoint
-public class MainActivity extends BaseActivity {
-
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.activity_main);
- Log.i(TAG, "onCreate: ");
-
- startActivity(new Intent(this, StockA.class));
- }
-}
\ No newline at end of file
diff --git a/app/src/main/java/com/sky/android_mvvm_basic_framework/ui/SplashScreenActivity.java b/app/src/main/java/com/sky/android_mvvm_basic_framework/ui/SplashScreenActivity.java
deleted file mode 100644
index 272eff45205e91cce885a56d77b93911a960a563..0000000000000000000000000000000000000000
--- a/app/src/main/java/com/sky/android_mvvm_basic_framework/ui/SplashScreenActivity.java
+++ /dev/null
@@ -1,42 +0,0 @@
-package com.sky.android_mvvm_basic_framework.ui;
-
-import android.content.Intent;
-import android.os.Bundle;
-import android.os.PersistableBundle;
-
-import androidx.annotation.Nullable;
-import androidx.appcompat.app.AppCompatActivity;
-
-import com.sky.android_mvvm_basic_framework.MainActivity;
-import com.sky.android_mvvm_basic_framework.databinding.ActivitySplashScreenBinding;
-import com.sky.android_mvvm_basic_framework.viewmodels.SplashViewModel;
-
-import dagger.hilt.android.AndroidEntryPoint;
-
-@AndroidEntryPoint
-public class SplashScreenActivity extends AppCompatActivity {
-
- private ActivitySplashScreenBinding binding;
- private SplashViewModel viewModel;
-
- @Override
- public void onCreate(@Nullable Bundle savedInstanceState, @Nullable PersistableBundle persistentState) {
- super.onCreate(savedInstanceState, persistentState);
- binding = ActivitySplashScreenBinding.inflate(getLayoutInflater());
- setContentView(binding.getRoot());
-
- navigateActivity();
- }
-
- private void navigateActivity() {
- final Intent intent = new Intent(SplashScreenActivity.this, StockDetailA.class);
- intent.addFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION);
- startActivity(intent);
- finish();
- }
-
- @Override
- public void onBackPressed() {
- // We don't want the splash screen to be interrupted
- }
-}
diff --git a/app/src/main/java/com/sky/financelake/adapter/BaseAdapter.java b/app/src/main/java/com/sky/financelake/adapter/BaseAdapter.java
new file mode 100644
index 0000000000000000000000000000000000000000..6570fdf21ed17db5caa8f83f45b7b6fb273ce42d
--- /dev/null
+++ b/app/src/main/java/com/sky/financelake/adapter/BaseAdapter.java
@@ -0,0 +1,95 @@
+package com.sky.financelake.adapter;
+
+import android.graphics.drawable.AnimationDrawable;
+import android.view.ViewGroup;
+
+import androidx.annotation.NonNull;
+import androidx.appcompat.widget.AppCompatImageView;
+import androidx.appcompat.widget.AppCompatTextView;
+import androidx.lifecycle.LifecycleOwner;
+import androidx.lifecycle.LiveData;
+import androidx.recyclerview.widget.RecyclerView;
+
+import com.sky.financelake.databinding.ItemCommonFooterBinding;
+import com.sky.financelake.retrofit.ApiResponse;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public abstract class BaseAdapter extends RecyclerView.Adapter {
+
+ protected static String TAG = BaseAdapter.class.getCanonicalName();
+ public List datas = new ArrayList<>();
+
+ // 普通布局
+ public static final int TYPE_ITEM = 1;
+ // 脚布局
+ public static final int TYPE_FOOTER = 2;
+ // 当前加载状态,默认为加载完成
+ public int loadStatus = 2;
+ // 正在加载
+ public static final int LOADING = 1;
+ // 加载完成
+ public static final int LOADING_COMPLETE = 2;
+ // 加载到底
+ public static final int LOADING_END = 3;
+
+ /**
+ * 底部加载更多菊花drawable
+ */
+ protected AnimationDrawable loadAd;
+
+ public OnItemClickListener mOnItemClickListener;
+
+ protected LifecycleOwner owner;
+
+ protected LiveData> liveData;
+
+ @NonNull
+ @Override
+ public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
+ return null;
+ }
+
+ @Override
+ public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
+
+ }
+
+ @Override
+ public int getItemCount() {
+ return datas.size() + 1;
+ }
+
+ @Override
+ public int getItemViewType(int position) {
+ // 最后一个item设置为FooterView
+ if (position + 1 == getItemCount()) {
+ return TYPE_FOOTER;
+ } else {
+ return TYPE_ITEM;
+ }
+ }
+
+ @FunctionalInterface
+ public interface OnItemClickListener {
+ void onClick(final Integer position, final Object o);
+ }
+
+ public void setOnItemClickListener(@NonNull final OnItemClickListener listener) {
+ mOnItemClickListener = listener;
+ }
+
+ public class FootViewHolder extends RecyclerView.ViewHolder {
+
+ AppCompatImageView loading;
+ AppCompatTextView loadEnd;
+
+ FootViewHolder(@NonNull ItemCommonFooterBinding binding) {
+ super(binding.getRoot());
+ loading = (AppCompatImageView) binding.loading;
+ loadEnd = (AppCompatTextView) binding.loadEnd;
+ loadAd = (AnimationDrawable) loading.getDrawable();
+ }
+ }
+}
diff --git a/app/src/main/java/com/sky/financelake/adapter/CommunitySkillAdapter.java b/app/src/main/java/com/sky/financelake/adapter/CommunitySkillAdapter.java
new file mode 100644
index 0000000000000000000000000000000000000000..ebce0e281c4a6f79398007ccd7ff7264461c4c64
--- /dev/null
+++ b/app/src/main/java/com/sky/financelake/adapter/CommunitySkillAdapter.java
@@ -0,0 +1,128 @@
+package com.sky.financelake.adapter;
+
+import android.content.Context;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+
+import androidx.annotation.NonNull;
+import androidx.appcompat.widget.AppCompatImageView;
+import androidx.appcompat.widget.AppCompatTextView;
+import androidx.constraintlayout.widget.ConstraintLayout;
+import androidx.recyclerview.widget.RecyclerView;
+
+import com.sky.financelake.bean.dto.CommunityDto;
+import com.sky.financelake.databinding.ItemCommonFooterBinding;
+import com.sky.financelake.databinding.ItemCommunitySkillBinding;
+import com.sky.financelake.glide.GlideImgManager;
+
+import java.util.List;
+
+public class CommunitySkillAdapter extends BaseAdapter {
+
+ private Context mContext;
+
+ public CommunitySkillAdapter(Context mContext, List communityDtos) {
+ this.mContext = mContext;
+ this.datas = communityDtos;
+ }
+
+ @NonNull
+ @Override
+ public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
+ if (viewType == TYPE_ITEM) {
+ ItemCommunitySkillBinding binding = ItemCommunitySkillBinding.inflate(LayoutInflater.from(parent.getContext()), parent, false);
+ return new Holder(binding);
+
+ } else if (viewType == TYPE_FOOTER) {
+ ItemCommonFooterBinding binding = ItemCommonFooterBinding.inflate(LayoutInflater.from(parent.getContext()), parent, false);
+ return new FootViewHolder(binding);
+ }
+ return null;
+
+ }
+
+ @Override
+ public void onBindViewHolder(@NonNull RecyclerView.ViewHolder h, int position) {
+
+ if (h instanceof Holder) {
+ Holder holder = (Holder) h;
+ holder.tvTitle.setText(datas.get(position).title);
+ holder.tvTag.setText(datas.get(position).tag);
+ holder.tvAuthor.setText(datas.get(position).username);
+ GlideImgManager.glideLoader(mContext, datas.get(position).cover, holder.ivCover, GlideImgManager.Type.Radius);
+ } else {
+
+ FootViewHolder footViewHolder = (FootViewHolder) h;
+ switch (loadStatus) {
+ case LOADING: // 正在加载
+ loadAd.start();
+ footViewHolder.loading.setVisibility(View.VISIBLE);
+ footViewHolder.loadEnd.setVisibility(View.GONE);
+ break;
+ case LOADING_END: // 加载到底
+ footViewHolder.loading.setVisibility(View.GONE);
+ footViewHolder.loadEnd.setVisibility(View.VISIBLE);
+ break;
+
+ default:
+ break;
+ }
+ }
+
+ }
+
+ @Override
+ public int getItemCount() {
+ return datas.size() + 1;
+ }
+
+ /**
+ * 设置上拉加载状态
+ *
+ * @param loadState 0.正在加载 1.加载完成 2.加载到底
+ */
+ public void setStatus(int status) {
+// Log.i(TAG, "setLoadState: ");
+// if (loadAd != null && loadState == LOADING) {
+// loadAd.start();
+// }
+ this.loadStatus = status;
+ notifyDataSetChanged();
+ }
+
+ public Integer getStatus(){
+ return loadStatus;
+ }
+
+
+ public void clearData() {
+ datas.clear();
+ }
+
+
+ private final class Holder extends RecyclerView.ViewHolder {
+ ConstraintLayout container;
+ AppCompatTextView tvTitle, tvAuthor, tvTag;
+ AppCompatImageView ivCover;
+
+ private Holder(final @NonNull ItemCommunitySkillBinding binding) {
+ super(binding.getRoot());
+ container = binding.container;
+ tvTitle = binding.tvTitle;
+ tvAuthor = binding.tvAuthor;
+ tvTag = binding.tvTag;
+ ivCover = binding.ivCover;
+ container.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ if (mOnItemClickListener != null) {
+ Integer position = getAbsoluteAdapterPosition();
+ mOnItemClickListener.onClick(position, datas.get(position));
+ }
+ }
+ });
+ }
+ }
+
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/sky/financelake/adapter/CommunityTabAdapter.java b/app/src/main/java/com/sky/financelake/adapter/CommunityTabAdapter.java
new file mode 100644
index 0000000000000000000000000000000000000000..66338191cef720c0239254a9c14590c120581b94
--- /dev/null
+++ b/app/src/main/java/com/sky/financelake/adapter/CommunityTabAdapter.java
@@ -0,0 +1,33 @@
+package com.sky.financelake.adapter;
+
+import androidx.annotation.NonNull;
+import androidx.fragment.app.Fragment;
+import androidx.fragment.app.FragmentActivity;
+import androidx.viewpager2.adapter.FragmentStateAdapter;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class CommunityTabAdapter extends FragmentStateAdapter {
+
+ private List fragments = new ArrayList<>();
+
+ public CommunityTabAdapter(@NonNull FragmentActivity fragmentActivity, List fragments) {
+ super(fragmentActivity);
+ this.fragments = fragments;
+ }
+
+ @NonNull
+ @Override
+ public Fragment createFragment(int position) {
+ return fragments.get(position);
+ }
+
+ @Override
+ public int getItemCount() {
+ return fragments.size();
+ }
+
+
+
+}
diff --git a/app/src/main/java/com/sky/android_mvvm_basic_framework/adapter/StockAdapter.java b/app/src/main/java/com/sky/financelake/adapter/StockAdapter.java
similarity index 93%
rename from app/src/main/java/com/sky/android_mvvm_basic_framework/adapter/StockAdapter.java
rename to app/src/main/java/com/sky/financelake/adapter/StockAdapter.java
index dbc6b35272c556f88827985e4b7625240e6a90d2..f1bc6e456ab18922da01954a34ff9cd7623022ea 100644
--- a/app/src/main/java/com/sky/android_mvvm_basic_framework/adapter/StockAdapter.java
+++ b/app/src/main/java/com/sky/financelake/adapter/StockAdapter.java
@@ -1,4 +1,4 @@
-package com.sky.android_mvvm_basic_framework.adapter;
+package com.sky.financelake.adapter;
import android.content.Context;
import android.view.LayoutInflater;
@@ -9,8 +9,8 @@ import androidx.annotation.NonNull;
import androidx.appcompat.widget.AppCompatTextView;
import androidx.recyclerview.widget.RecyclerView;
-import com.sky.android_mvvm_basic_framework.R;
-import com.sky.android_mvvm_basic_framework.model.dto.StockDto;
+import com.sky.financelake.R;
+import com.sky.financelake.bean.dto.StockDto;
import java.util.List;
diff --git a/app/src/main/java/com/sky/android_mvvm_basic_framework/App.java b/app/src/main/java/com/sky/financelake/app/App.java
similarity index 82%
rename from app/src/main/java/com/sky/android_mvvm_basic_framework/App.java
rename to app/src/main/java/com/sky/financelake/app/App.java
index 9b7e809ac5a4f68b7daa909c139cbb7cc1d86923..f461fd6ce0c05d24e2d2c5a183112861d307dcca 100644
--- a/app/src/main/java/com/sky/android_mvvm_basic_framework/App.java
+++ b/app/src/main/java/com/sky/financelake/app/App.java
@@ -1,4 +1,4 @@
-package com.sky.android_mvvm_basic_framework;
+package com.sky.financelake.app;
import android.app.Application;
diff --git a/app/src/main/java/com/sky/android_mvvm_basic_framework/base/BaseActivity.java b/app/src/main/java/com/sky/financelake/base/BaseA.java
similarity index 53%
rename from app/src/main/java/com/sky/android_mvvm_basic_framework/base/BaseActivity.java
rename to app/src/main/java/com/sky/financelake/base/BaseA.java
index 8781ea26f251321c24e45a9efb05ae4f44c83ad8..22f0022589386c686699b8f86f554fc56290f1f6 100644
--- a/app/src/main/java/com/sky/android_mvvm_basic_framework/base/BaseActivity.java
+++ b/app/src/main/java/com/sky/financelake/base/BaseA.java
@@ -1,8 +1,8 @@
-package com.sky.android_mvvm_basic_framework.base;
+package com.sky.financelake.base;
import androidx.appcompat.app.AppCompatActivity;
-public class BaseActivity extends AppCompatActivity {
+public class BaseA extends AppCompatActivity {
protected final String TAG = this.getClass().getCanonicalName();
}
diff --git a/app/src/main/java/com/sky/financelake/base/BaseF.java b/app/src/main/java/com/sky/financelake/base/BaseF.java
new file mode 100644
index 0000000000000000000000000000000000000000..3c83981a9c1cb8c4dee2a183532ba3598fe5acf4
--- /dev/null
+++ b/app/src/main/java/com/sky/financelake/base/BaseF.java
@@ -0,0 +1,8 @@
+package com.sky.financelake.base;
+
+import androidx.fragment.app.Fragment;
+
+public class BaseF extends Fragment {
+
+ protected final String TAG = this.getClass().getCanonicalName();
+}
diff --git a/app/src/main/java/com/sky/financelake/bean/dto/CommunityDto.java b/app/src/main/java/com/sky/financelake/bean/dto/CommunityDto.java
new file mode 100644
index 0000000000000000000000000000000000000000..9ae0f1dd26cd93e1d1f58495eabae089808d7ae1
--- /dev/null
+++ b/app/src/main/java/com/sky/financelake/bean/dto/CommunityDto.java
@@ -0,0 +1,59 @@
+package com.sky.financelake.bean.dto;
+
+import android.os.Parcel;
+import android.os.Parcelable;
+
+public class CommunityDto implements Parcelable {
+
+ public CommunityDto() {
+ }
+
+ public Integer id;
+ public String tag;
+ public String title;
+ public String username;
+ public String cover;
+
+
+ @Override
+ public int describeContents() {
+ return 0;
+ }
+
+ @Override
+ public void writeToParcel(Parcel dest, int flags) {
+ dest.writeValue(this.id);
+ dest.writeString(this.tag);
+ dest.writeString(this.title);
+ dest.writeString(this.username);
+ dest.writeString(this.cover);
+ }
+
+ public void readFromParcel(Parcel source) {
+ this.id = (Integer) source.readValue(Integer.class.getClassLoader());
+ this.tag = source.readString();
+ this.title = source.readString();
+ this.username = source.readString();
+ this.cover = source.readString();
+ }
+
+ protected CommunityDto(Parcel in) {
+ this.id = (Integer) in.readValue(Integer.class.getClassLoader());
+ this.tag = in.readString();
+ this.title = in.readString();
+ this.username = in.readString();
+ this.cover = in.readString();
+ }
+
+ public static final Parcelable.Creator CREATOR = new Parcelable.Creator() {
+ @Override
+ public CommunityDto createFromParcel(Parcel source) {
+ return new CommunityDto(source);
+ }
+
+ @Override
+ public CommunityDto[] newArray(int size) {
+ return new CommunityDto[size];
+ }
+ };
+}
diff --git a/app/src/main/java/com/sky/android_mvvm_basic_framework/model/dto/QuotationDto.java b/app/src/main/java/com/sky/financelake/bean/dto/QuotationDto.java
similarity index 99%
rename from app/src/main/java/com/sky/android_mvvm_basic_framework/model/dto/QuotationDto.java
rename to app/src/main/java/com/sky/financelake/bean/dto/QuotationDto.java
index 37810d6984759b96c19b170aaff11990e4046669..831e867a0ee835373d235aecdf34deafd3a75d84 100644
--- a/app/src/main/java/com/sky/android_mvvm_basic_framework/model/dto/QuotationDto.java
+++ b/app/src/main/java/com/sky/financelake/bean/dto/QuotationDto.java
@@ -1,4 +1,4 @@
-package com.sky.android_mvvm_basic_framework.model.dto;
+package com.sky.financelake.bean.dto;
import android.os.Parcel;
import android.os.Parcelable;
diff --git a/app/src/main/java/com/sky/android_mvvm_basic_framework/model/dto/StockDto.java b/app/src/main/java/com/sky/financelake/bean/dto/StockDto.java
similarity index 98%
rename from app/src/main/java/com/sky/android_mvvm_basic_framework/model/dto/StockDto.java
rename to app/src/main/java/com/sky/financelake/bean/dto/StockDto.java
index c79bfe8112b6dbe15929762518b506ca20693050..f594d0a77afb714475b93267a1ca4f8e7310b50f 100644
--- a/app/src/main/java/com/sky/android_mvvm_basic_framework/model/dto/StockDto.java
+++ b/app/src/main/java/com/sky/financelake/bean/dto/StockDto.java
@@ -1,4 +1,4 @@
-package com.sky.android_mvvm_basic_framework.model.dto;
+package com.sky.financelake.bean.dto;
import android.os.Parcel;
import android.os.Parcelable;
diff --git a/app/src/main/java/com/sky/financelake/bean/entity/CommunityEntity.java b/app/src/main/java/com/sky/financelake/bean/entity/CommunityEntity.java
new file mode 100644
index 0000000000000000000000000000000000000000..6e57f82bd06842cbae98fe551c420bf5847769ee
--- /dev/null
+++ b/app/src/main/java/com/sky/financelake/bean/entity/CommunityEntity.java
@@ -0,0 +1,154 @@
+package com.sky.financelake.bean.entity;
+
+import java.io.Serializable;
+import java.time.LocalDateTime;
+
+public class CommunityEntity implements Serializable {
+ private Integer id;
+
+ /**
+ * 关联的股票
+ */
+ private String stocks;
+
+ /**
+ * 热度
+ */
+ private Integer hot;
+
+ /**
+ * 标签
+ */
+ private String tag;
+
+ private String title;
+
+ /**
+ * 封面图片
+ */
+ private String cover;
+
+ private Integer userId;
+
+ private String text;
+
+ /**
+ * 文章类型
+ */
+ private Integer type;
+
+ private Integer views;
+
+ private Integer likes;
+
+ private Integer sharers;
+
+ private String createTime;
+
+
+ public Integer getId() {
+ return id;
+ }
+
+ public void setId(Integer id) {
+ this.id = id;
+ }
+
+ public String getStocks() {
+ return stocks;
+ }
+
+ public void setStocks(String stocks) {
+ this.stocks = stocks;
+ }
+
+ public Integer getHot() {
+ return hot;
+ }
+
+ public void setHot(Integer hot) {
+ this.hot = hot;
+ }
+
+ public String getTag() {
+ return tag;
+ }
+
+ public void setTag(String tag) {
+ this.tag = tag;
+ }
+
+ public String getTitle() {
+ return title;
+ }
+
+ public void setTitle(String title) {
+ this.title = title;
+ }
+
+ public String getCover() {
+ return cover;
+ }
+
+ public void setCover(String cover) {
+ this.cover = cover;
+ }
+
+ public Integer getUserId() {
+ return userId;
+ }
+
+ public void setUserId(Integer userId) {
+ this.userId = userId;
+ }
+
+ public String getText() {
+ return text;
+ }
+
+ public void setText(String text) {
+ this.text = text;
+ }
+
+ public Integer getType() {
+ return type;
+ }
+
+ public void setType(Integer type) {
+ this.type = type;
+ }
+
+ public Integer getViews() {
+ return views;
+ }
+
+ public void setViews(Integer views) {
+ this.views = views;
+ }
+
+ public Integer getLikes() {
+ return likes;
+ }
+
+ public void setLikes(Integer likes) {
+ this.likes = likes;
+ }
+
+ public Integer getSharers() {
+ return sharers;
+ }
+
+ public void setSharers(Integer sharers) {
+ this.sharers = sharers;
+ }
+
+ public String getCreateTime() {
+ return createTime;
+ }
+
+ public void setCreateTime(String createTime) {
+ this.createTime = createTime;
+ }
+
+
+}
diff --git a/app/src/main/java/com/sky/financelake/bean/param/CommunityParam.java b/app/src/main/java/com/sky/financelake/bean/param/CommunityParam.java
new file mode 100644
index 0000000000000000000000000000000000000000..ef0496f78ce97aff0d82985acea5d77464dd69fc
--- /dev/null
+++ b/app/src/main/java/com/sky/financelake/bean/param/CommunityParam.java
@@ -0,0 +1,18 @@
+package com.sky.financelake.bean.param;
+
+public class CommunityParam extends PagingParam{
+
+ private Integer type;
+
+ public CommunityParam() {
+ }
+
+ public Integer getType() {
+ return type;
+ }
+
+ public void setType(Integer type) {
+ this.type = type;
+ }
+
+}
diff --git a/app/src/main/java/com/sky/android_mvvm_basic_framework/model/param/PagingParam.java b/app/src/main/java/com/sky/financelake/bean/param/PagingParam.java
similarity index 47%
rename from app/src/main/java/com/sky/android_mvvm_basic_framework/model/param/PagingParam.java
rename to app/src/main/java/com/sky/financelake/bean/param/PagingParam.java
index e590ebe869346e23ec9d5be4fa7e2647428c8b17..77685e42b9f9276c9154c23d705d453001bd4ffc 100644
--- a/app/src/main/java/com/sky/android_mvvm_basic_framework/model/param/PagingParam.java
+++ b/app/src/main/java/com/sky/financelake/bean/param/PagingParam.java
@@ -1,25 +1,11 @@
-package com.sky.android_mvvm_basic_framework.model.param;
+package com.sky.financelake.bean.param;
public class PagingParam {
- private Integer offset;
private Integer pageNo;
private Integer pageSize;
- public Integer getOffset() {
- if (this.offset != null) {
- return this.offset;
- } else {
- this.offset = this.pageNo != null && this.pageNo > 0 && this.pageSize != null && this.pageSize > 0 ? (this.pageNo - 1) * this.pageSize : 0;
- return this.offset;
- }
- }
-
- public void setOffset(int offset) {
- this.offset = offset;
- }
-
public Integer getPageNo() {
return pageNo;
diff --git a/app/src/main/java/com/sky/android_mvvm_basic_framework/model/param/StockParam.java b/app/src/main/java/com/sky/financelake/bean/param/StockParam.java
similarity index 95%
rename from app/src/main/java/com/sky/android_mvvm_basic_framework/model/param/StockParam.java
rename to app/src/main/java/com/sky/financelake/bean/param/StockParam.java
index 627199f8d9011c402485cb2ab48019886dcb28fe..091e26d4b4897ef617c8f8f1549fd436a2ae371d 100644
--- a/app/src/main/java/com/sky/android_mvvm_basic_framework/model/param/StockParam.java
+++ b/app/src/main/java/com/sky/financelake/bean/param/StockParam.java
@@ -1,4 +1,4 @@
-package com.sky.android_mvvm_basic_framework.model.param;
+package com.sky.financelake.bean.param;
public class StockParam extends PagingParam{
diff --git a/app/src/main/java/com/sky/financelake/glide/GlideCircleTransform.java b/app/src/main/java/com/sky/financelake/glide/GlideCircleTransform.java
new file mode 100644
index 0000000000000000000000000000000000000000..87841dfa0fa4b45208ede655e787d953bcd86dca
--- /dev/null
+++ b/app/src/main/java/com/sky/financelake/glide/GlideCircleTransform.java
@@ -0,0 +1,71 @@
+package com.sky.financelake.glide;
+
+import android.content.Context;
+import android.graphics.Bitmap;
+import android.graphics.BitmapShader;
+import android.graphics.Canvas;
+import android.graphics.Paint;
+
+import androidx.annotation.NonNull;
+
+import com.bumptech.glide.load.engine.bitmap_recycle.BitmapPool;
+import com.bumptech.glide.load.resource.bitmap.BitmapTransformation;
+
+import java.nio.charset.Charset;
+import java.security.MessageDigest;
+
+/**
+ * @author :
+ * @describe :
+ * @since :2016-10-22 下午8:14
+ **/
+public class GlideCircleTransform extends BitmapTransformation {
+
+ private static final String ID = "com.bumptech.glide.transformations.FitTopTransformation";
+ private static final byte[] ID_BYTES = ID.getBytes(Charset.forName("UTF-8"));
+
+ @Override
+ protected Bitmap transform(BitmapPool pool, Bitmap toTransform, int outWidth, int outHeight) {
+ return circleCrop(pool, toTransform);
+ }
+
+ private static Bitmap circleCrop(BitmapPool pool, Bitmap source) {
+ if (source == null) return null;
+
+ int size = Math.min(source.getWidth(), source.getHeight());
+ int x = (source.getWidth() - size) / 2;
+ int y = (source.getHeight() - size) / 2;
+
+ // TODO this could be acquired from the pool too
+ Bitmap squared = Bitmap.createBitmap(source, x, y, size, size);
+
+ Bitmap result = pool.get(size, size, Bitmap.Config.ARGB_8888);
+ if (result == null) {
+ result = Bitmap.createBitmap(size, size, Bitmap.Config.ARGB_8888);
+ }
+
+ Canvas canvas = new Canvas(result);
+ Paint paint = new Paint();
+ paint.setShader(new BitmapShader(squared, BitmapShader.TileMode.CLAMP, BitmapShader.TileMode.CLAMP));
+ paint.setAntiAlias(true);
+ float r = size / 2f;
+ canvas.drawCircle(r, r, r, paint);
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ return o instanceof GlideCircleTransform;
+ }
+
+ @Override
+ public int hashCode() {
+ return ID.hashCode();
+ }
+
+
+ @Override
+ public void updateDiskCacheKey(MessageDigest messageDigest) {
+ messageDigest.update(ID_BYTES);
+ }
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/sky/financelake/glide/GlideImgManager.java b/app/src/main/java/com/sky/financelake/glide/GlideImgManager.java
new file mode 100644
index 0000000000000000000000000000000000000000..e35b5eb4f5ec3e1bd5ee40383d73ad0fbe31ec22
--- /dev/null
+++ b/app/src/main/java/com/sky/financelake/glide/GlideImgManager.java
@@ -0,0 +1,72 @@
+package com.sky.financelake.glide;
+
+
+import android.content.Context;
+import android.widget.ImageView;
+
+import com.bumptech.glide.Glide;
+
+/**
+ * @author :
+ * @describe :
+ * @since :2016-10-22 下午8:13
+ **/
+public class GlideImgManager {
+ /**
+ * load normal for img
+ *
+ * @param url
+ * @param erroImg
+ * @param emptyImg
+ * @param iv
+ */
+ public static void glideLoader(Context context, String url, int erroImg, int emptyImg, ImageView iv) {
+ //原生 API
+ Glide.with(context).load(url).placeholder(emptyImg).error(erroImg).into(iv);
+ }
+
+ /**
+ * load normal for circle or round img
+ *
+ * @param url
+ * @param erroImg
+ * @param emptyImg
+ * @param iv
+ * @param type
+ */
+ public static void glideLoader(Context context, String url, int erroImg, int emptyImg, ImageView iv, Type type) {
+ switch (type) {
+ case Circle:
+ Glide.with(context).load(url).placeholder(emptyImg).error(erroImg).transform(new GlideCircleTransform()).into(iv);
+ break;
+ case Normal:
+ Glide.with(context).load(url).placeholder(emptyImg).error(erroImg).into(iv);
+ break;
+ }
+ }
+
+ /**
+ * load normal for circle or round img
+ *
+ * @param url
+ * @param iv
+ * @param type
+ */
+ public static void glideLoader(Context context, String url, ImageView iv, Type type) {
+ switch (type) {
+ case Circle:
+ Glide.with(context).load(url).transform(new GlideCircleTransform()).into(iv);
+ break;
+ case Normal:
+ Glide.with(context).load(url).into(iv);
+ break;
+ case Radius:
+ Glide.with(context).load(url).transform(new GlideRadiusTransform(30)).into(iv);
+ break;
+ }
+ }
+
+ public enum Type {
+ Circle, Normal, Radius
+ }
+}
diff --git a/app/src/main/java/com/sky/financelake/glide/GlideRadiusTransform.java b/app/src/main/java/com/sky/financelake/glide/GlideRadiusTransform.java
new file mode 100644
index 0000000000000000000000000000000000000000..7f1173eb902aa767e741d22b71445f710b00b232
--- /dev/null
+++ b/app/src/main/java/com/sky/financelake/glide/GlideRadiusTransform.java
@@ -0,0 +1,62 @@
+package com.sky.financelake.glide;
+
+import android.graphics.Bitmap;
+import android.graphics.BitmapShader;
+import android.graphics.Canvas;
+import android.graphics.Paint;
+import android.graphics.RectF;
+
+import androidx.annotation.NonNull;
+
+import com.bumptech.glide.load.engine.bitmap_recycle.BitmapPool;
+import com.bumptech.glide.load.resource.bitmap.BitmapTransformation;
+
+import java.nio.charset.Charset;
+import java.security.MessageDigest;
+
+public class GlideRadiusTransform extends BitmapTransformation {
+
+ private static final String ID = "com.bumptech.glide.transformations.FitTopTransformation";
+ private static final byte[] ID_BYTES = ID.getBytes(Charset.forName("UTF-8"));
+ private static float radius = 0f;
+
+ public GlideRadiusTransform() {
+ this(4);
+ }
+
+ public GlideRadiusTransform(int dp) {
+ this.radius = dp;
+ }
+
+ private static Bitmap roundCrop(BitmapPool pool, Bitmap source) {
+ if (source == null) return null;
+
+ Bitmap result = pool.get(source.getWidth(), source.getHeight(), Bitmap.Config.ARGB_8888);
+ if (result == null) {
+ result = Bitmap.createBitmap(source.getWidth(), source.getHeight(), Bitmap.Config.ARGB_8888);
+ }
+
+ Canvas canvas = new Canvas(result);
+ Paint paint = new Paint();
+ paint.setShader(new BitmapShader(source, BitmapShader.TileMode.CLAMP, BitmapShader.TileMode.CLAMP));
+ paint.setAntiAlias(true);
+ RectF rectF = new RectF(0f, 0f, source.getWidth(), source.getHeight());
+ canvas.drawRoundRect(rectF, radius, radius, paint);
+ return result;
+ }
+
+ @Override
+ public int hashCode() {
+ return ID.hashCode();
+ }
+
+ @Override
+ protected Bitmap transform(@NonNull BitmapPool pool, @NonNull Bitmap toTransform, int outWidth, int outHeight) {
+ return roundCrop(pool, toTransform);
+ }
+
+ @Override
+ public void updateDiskCacheKey(@NonNull MessageDigest messageDigest) {
+ messageDigest.update(ID_BYTES);
+ }
+}
diff --git a/app/src/main/java/com/sky/android_mvvm_basic_framework/retrofit/Api.java b/app/src/main/java/com/sky/financelake/retrofit/Api.java
similarity index 35%
rename from app/src/main/java/com/sky/android_mvvm_basic_framework/retrofit/Api.java
rename to app/src/main/java/com/sky/financelake/retrofit/Api.java
index dc046bef93c93e0be5e633544a875d298899e098..1df40ca19541f89ccc33fd63ec07ff0a94088f1e 100644
--- a/app/src/main/java/com/sky/android_mvvm_basic_framework/retrofit/Api.java
+++ b/app/src/main/java/com/sky/financelake/retrofit/Api.java
@@ -1,15 +1,18 @@
-package com.sky.android_mvvm_basic_framework.retrofit;
+package com.sky.financelake.retrofit;
-import com.sky.android_mvvm_basic_framework.model.dto.QuotationDto;
-import com.sky.android_mvvm_basic_framework.model.dto.StockDto;
-import com.sky.android_mvvm_basic_framework.model.param.StockParam;
+import com.sky.financelake.bean.dto.CommunityDto;
+import com.sky.financelake.bean.dto.QuotationDto;
+import com.sky.financelake.bean.dto.StockDto;
+import com.sky.financelake.bean.entity.CommunityEntity;
+import com.sky.financelake.bean.param.CommunityParam;
+import com.sky.financelake.bean.param.StockParam;
import java.util.List;
import retrofit2.Call;
import retrofit2.http.Body;
-import retrofit2.http.FieldMap;
import retrofit2.http.GET;
+import retrofit2.http.POST;
import retrofit2.http.Query;
public interface Api {
@@ -20,6 +23,12 @@ public interface Api {
@GET("quotation/getAllQuotationByCode")
Call>> getAllQuotationByCode(@Query("tsCode") String tsCode);
- @GET("stock/getPagingList")
- Call>> getStockPagingList(StockParam param);
+ @POST("stock/getPagingList")
+ Call>> getStockPagingList(@Body StockParam param);
+
+ @POST("article/getPagingList")
+ Call>> getCommunityPagingList(@Body CommunityParam param);
+
+ @GET("article/getArticleById")
+ Call> getArticleById(@Query("id") Integer id);
}
diff --git a/app/src/main/java/com/sky/android_mvvm_basic_framework/retrofit/ApiResponse.java b/app/src/main/java/com/sky/financelake/retrofit/ApiResponse.java
similarity index 94%
rename from app/src/main/java/com/sky/android_mvvm_basic_framework/retrofit/ApiResponse.java
rename to app/src/main/java/com/sky/financelake/retrofit/ApiResponse.java
index a0273641f76ae011f24f8a93da952914cdf823a9..aff59ddf4ccd9c0fd2a325f0c87493e8367f786a 100644
--- a/app/src/main/java/com/sky/android_mvvm_basic_framework/retrofit/ApiResponse.java
+++ b/app/src/main/java/com/sky/financelake/retrofit/ApiResponse.java
@@ -1,4 +1,4 @@
-package com.sky.android_mvvm_basic_framework.retrofit;
+package com.sky.financelake.retrofit;
import java.io.Serializable;
diff --git a/app/src/main/java/com/sky/financelake/retrofit/BaseRepository.java b/app/src/main/java/com/sky/financelake/retrofit/BaseRepository.java
new file mode 100644
index 0000000000000000000000000000000000000000..378212bac0501990ab3f4eb97d920161f98d79ee
--- /dev/null
+++ b/app/src/main/java/com/sky/financelake/retrofit/BaseRepository.java
@@ -0,0 +1,5 @@
+package com.sky.financelake.retrofit;
+
+public class BaseRepository {
+ protected static String TAG = BaseRepository.class.getCanonicalName();
+}
diff --git a/app/src/main/java/com/sky/financelake/retrofit/CommunityRepository.java b/app/src/main/java/com/sky/financelake/retrofit/CommunityRepository.java
new file mode 100644
index 0000000000000000000000000000000000000000..27df87329997ec502a13f98ada450f92e487f6e5
--- /dev/null
+++ b/app/src/main/java/com/sky/financelake/retrofit/CommunityRepository.java
@@ -0,0 +1,70 @@
+package com.sky.financelake.retrofit;
+
+import android.util.Log;
+
+import androidx.lifecycle.MutableLiveData;
+
+import com.sky.financelake.bean.dto.CommunityDto;
+import com.sky.financelake.bean.entity.CommunityEntity;
+import com.sky.financelake.bean.param.CommunityParam;
+
+import java.util.List;
+
+import retrofit2.Call;
+import retrofit2.Callback;
+import retrofit2.Response;
+
+public class CommunityRepository extends BaseRepository{
+
+
+ private static CommunityRepository communityRepository;
+
+ public static CommunityRepository getInstance() {
+ if (communityRepository == null) {
+ communityRepository = new CommunityRepository();
+ }
+ return communityRepository;
+ }
+
+ private Api api;
+
+ public CommunityRepository() {
+ api = RetrofitService.cteateService(Api.class);
+ }
+
+
+ public void getCommunityPagingList(MutableLiveData data, CommunityParam param) {
+ Log.i(TAG, "getCommunityPagingList: ");
+ api.getCommunityPagingList(param).enqueue(new Callback>>() {
+ @Override
+ public void onResponse(Call>> call, Response>> response) {
+ if (response.body() != null) {
+ data.setValue(response.body());
+ }
+ }
+
+ @Override
+ public void onFailure(Call>> call, Throwable t) {
+ data.setValue(null);
+ }
+ });
+ }
+
+ public void getCommunityById(MutableLiveData liveData, Integer id) {
+ api.getArticleById(id).enqueue(new Callback>() {
+ @Override
+ public void onResponse(Call> call, Response> response) {
+ if (response.body() != null) {
+ liveData.setValue(response.body());
+ }
+ }
+
+ @Override
+ public void onFailure(Call> call, Throwable t) {
+ Log.i(TAG, "onFailure: ");
+ liveData.setValue(null);
+ }
+ });
+ }
+
+}
diff --git a/app/src/main/java/com/sky/android_mvvm_basic_framework/retrofit/QuotationRepository.java b/app/src/main/java/com/sky/financelake/retrofit/QuotationRepository.java
similarity index 86%
rename from app/src/main/java/com/sky/android_mvvm_basic_framework/retrofit/QuotationRepository.java
rename to app/src/main/java/com/sky/financelake/retrofit/QuotationRepository.java
index 229861beb94346d55ed990af4aaf836066d48f29..93ec986919cc02cd96db7dbf56d6005145b882f9 100644
--- a/app/src/main/java/com/sky/android_mvvm_basic_framework/retrofit/QuotationRepository.java
+++ b/app/src/main/java/com/sky/financelake/retrofit/QuotationRepository.java
@@ -1,9 +1,8 @@
-package com.sky.android_mvvm_basic_framework.retrofit;
+package com.sky.financelake.retrofit;
import androidx.lifecycle.MutableLiveData;
-import com.sky.android_mvvm_basic_framework.model.dto.QuotationDto;
-import com.sky.android_mvvm_basic_framework.model.dto.QuotationDto;
+import com.sky.financelake.bean.dto.QuotationDto;
import java.util.List;
diff --git a/app/src/main/java/com/sky/financelake/retrofit/RetrofitLogInterceptor.java b/app/src/main/java/com/sky/financelake/retrofit/RetrofitLogInterceptor.java
new file mode 100644
index 0000000000000000000000000000000000000000..f180f6f358e11eda486dc365e1f789e47578883b
--- /dev/null
+++ b/app/src/main/java/com/sky/financelake/retrofit/RetrofitLogInterceptor.java
@@ -0,0 +1,55 @@
+package com.sky.financelake.retrofit;
+
+
+import android.util.Log;
+
+import java.io.IOException;
+import java.nio.charset.Charset;
+
+import okhttp3.Interceptor;
+import okhttp3.MediaType;
+import okhttp3.Request;
+import okhttp3.RequestBody;
+import okio.Buffer;
+
+
+/**
+ * Created by wangmaobo on 2018/3/29.
+ */
+public class RetrofitLogInterceptor implements Interceptor {
+ public static String TAG = "RetrofitLogInterceptor";
+
+ @Override
+ public synchronized okhttp3.Response intercept(Chain chain) throws IOException {
+ Request request = chain.request();
+ long startTime = System.currentTimeMillis();
+ okhttp3.Response response = chain.proceed(chain.request());
+ long endTime = System.currentTimeMillis();
+ long duration = endTime - startTime;
+ okhttp3.MediaType mediaType = response.body().contentType();
+ String content = response.body().string();
+ printParams(request.body());
+ Log.e(TAG, "请求体返回:| Response:" + content);
+ Log.e(TAG, "----------请求耗时:" + duration + "毫秒----------");
+ return response.newBuilder().body(okhttp3.ResponseBody.create(mediaType, content)).build();
+ }
+
+
+ private void printParams(RequestBody body) {
+ if (body!=null){
+ Buffer buffer = new Buffer();
+ try {
+ body.writeTo(buffer);
+ Charset charset = Charset.forName("UTF-8");
+ MediaType contentType = body.contentType();
+ if (contentType != null) {
+ charset = contentType.charset(Charset.defaultCharset());
+ }
+ String params = buffer.readString(charset);
+ Log.e(TAG, "请求参数: | " + params);
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+ }
+}
diff --git a/app/src/main/java/com/sky/android_mvvm_basic_framework/retrofit/RetrofitService.java b/app/src/main/java/com/sky/financelake/retrofit/RetrofitService.java
similarity index 34%
rename from app/src/main/java/com/sky/android_mvvm_basic_framework/retrofit/RetrofitService.java
rename to app/src/main/java/com/sky/financelake/retrofit/RetrofitService.java
index 6fdf7a8d02ed0a98a1d409fc55e7afc9f63df6ef..23ea27d4ca72826df65046e523f38976ab678e32 100644
--- a/app/src/main/java/com/sky/android_mvvm_basic_framework/retrofit/RetrofitService.java
+++ b/app/src/main/java/com/sky/financelake/retrofit/RetrofitService.java
@@ -1,5 +1,9 @@
-package com.sky.android_mvvm_basic_framework.retrofit;
+package com.sky.financelake.retrofit;
+import android.util.Log;
+
+import okhttp3.OkHttpClient;
+import okhttp3.logging.HttpLoggingInterceptor;
import retrofit2.Retrofit;
import retrofit2.converter.gson.GsonConverterFactory;
@@ -7,6 +11,7 @@ public class RetrofitService {
private static Retrofit retrofit = new Retrofit.Builder()
.baseUrl("http://finance-api.qzlhq.com/")
+ .client(getClient())
.addConverterFactory(GsonConverterFactory.create())
.build();
@@ -14,4 +19,20 @@ public class RetrofitService {
public static S cteateService(Class serviceClass) {
return retrofit.create(serviceClass);
}
+
+ public static OkHttpClient getClient(){
+ RetrofitLogInterceptor interceptor = new RetrofitLogInterceptor();
+ HttpLoggingInterceptor loggingInterceptor = new HttpLoggingInterceptor(new HttpLoggingInterceptor.Logger() {
+ @Override
+ public void log(String message) {
+ //打印retrofit日志
+ Log.i("RetrofitLog","retrofitBack = "+message);
+ }
+ });
+ loggingInterceptor.setLevel(HttpLoggingInterceptor.Level.BODY);
+ OkHttpClient client = new OkHttpClient.Builder()
+ .addInterceptor(interceptor)
+ .build();
+ return client;
+ }
}
diff --git a/app/src/main/java/com/sky/android_mvvm_basic_framework/retrofit/StockRepository.java b/app/src/main/java/com/sky/financelake/retrofit/StockRepository.java
similarity index 90%
rename from app/src/main/java/com/sky/android_mvvm_basic_framework/retrofit/StockRepository.java
rename to app/src/main/java/com/sky/financelake/retrofit/StockRepository.java
index f41af226cccd7f4514338e67eeb37ff44aa0e061..85941207963ac6aad888c11aed1e76a4082119d8 100644
--- a/app/src/main/java/com/sky/android_mvvm_basic_framework/retrofit/StockRepository.java
+++ b/app/src/main/java/com/sky/financelake/retrofit/StockRepository.java
@@ -1,9 +1,9 @@
-package com.sky.android_mvvm_basic_framework.retrofit;
+package com.sky.financelake.retrofit;
import androidx.lifecycle.MutableLiveData;
-import com.sky.android_mvvm_basic_framework.model.dto.StockDto;
-import com.sky.android_mvvm_basic_framework.model.param.StockParam;
+import com.sky.financelake.bean.dto.StockDto;
+import com.sky.financelake.bean.param.StockParam;
import java.util.List;
diff --git a/app/src/main/java/com/sky/financelake/ui/activity/CommunityDetailA.java b/app/src/main/java/com/sky/financelake/ui/activity/CommunityDetailA.java
new file mode 100644
index 0000000000000000000000000000000000000000..6d1ff7860250af5611e84f3c2a678bcb18820077
--- /dev/null
+++ b/app/src/main/java/com/sky/financelake/ui/activity/CommunityDetailA.java
@@ -0,0 +1,95 @@
+package com.sky.financelake.ui.activity;
+
+import android.graphics.Bitmap;
+import android.os.Bundle;
+import android.util.Log;
+import android.view.MenuItem;
+
+import androidx.annotation.NonNull;
+import androidx.annotation.Nullable;
+import androidx.appcompat.widget.Toolbar;
+import androidx.lifecycle.ViewModelProvider;
+
+import com.bumptech.glide.Glide;
+import com.sky.financelake.base.BaseA;
+import com.sky.financelake.bean.entity.CommunityEntity;
+import com.sky.financelake.databinding.ActivityCommunityDetailBinding;
+import com.sky.financelake.viewmodels.CommunityViewModel;
+
+import java.io.IOException;
+import java.util.List;
+
+import cn.droidlover.xrichtext.ImageLoader;
+import cn.droidlover.xrichtext.XRichText;
+import dagger.hilt.android.AndroidEntryPoint;
+
+@AndroidEntryPoint
+public class CommunityDetailA extends BaseA {
+
+
+ private ActivityCommunityDetailBinding binding;
+ private CommunityViewModel communityViewModel;
+
+
+ @Override
+ protected void onCreate(@Nullable Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ binding = ActivityCommunityDetailBinding.inflate(getLayoutInflater());
+ setContentView(binding.getRoot());
+
+ Integer id = getIntent().getIntExtra("id", 0);
+ String title = getIntent().getStringExtra("title");
+
+ communityViewModel = new ViewModelProvider(this).get(CommunityViewModel.class);
+
+ Toolbar toolbar = binding.toolbarContainer.toolbar;
+ toolbar.setTitle(title);
+ setSupportActionBar(toolbar);
+ getSupportActionBar().setDisplayHomeAsUpEnabled(true);
+
+ XRichText richText = binding.richText;
+
+ communityViewModel.getCommunityById(id).observe(this, response -> {
+ CommunityEntity entity = (CommunityEntity) response.getResult();
+ richText.callback(new XRichText.Callback() {
+ @Override
+ public void onImageClick(List urlList, int position) {
+ Log.i(TAG, "onImageClick: ");
+ }
+
+ @Override
+ public boolean onLinkClick(String url) {
+ Log.i(TAG, "onLinkClick: ");
+ return false;
+ }
+
+ @Override
+ public void onFix(XRichText.ImageHolder holder) {
+ Log.i(TAG, "onFix: ");
+ }
+ }).imageDownloader(new ImageLoader() {
+ @Override
+ public Bitmap getBitmap(String url) throws IOException {
+ Bitmap bmp = null;
+ try {
+ bmp = Glide.with(CommunityDetailA.this).asBitmap().load(url).submit().get();
+ } catch (Exception e) {
+ Log.i(TAG, "getBitmap: " + e.getLocalizedMessage());
+ }
+ return bmp;
+ }
+ }).text(entity.getText());
+
+ });
+
+ }
+
+
+ @Override
+ public boolean onOptionsItemSelected(@NonNull MenuItem item) {
+ if (item.getItemId() == android.R.id.home) {
+ finish();
+ }
+ return super.onOptionsItemSelected(item);
+ }
+}
diff --git a/app/src/main/java/com/sky/android_mvvm_basic_framework/ui/KLineA.java b/app/src/main/java/com/sky/financelake/ui/activity/KLineA.java
similarity index 95%
rename from app/src/main/java/com/sky/android_mvvm_basic_framework/ui/KLineA.java
rename to app/src/main/java/com/sky/financelake/ui/activity/KLineA.java
index 1efe31e95c606424bdf3c2acec5803393083d5e7..dcc66a6b7a901923416493b1543940095c1b946b 100644
--- a/app/src/main/java/com/sky/android_mvvm_basic_framework/ui/KLineA.java
+++ b/app/src/main/java/com/sky/financelake/ui/activity/KLineA.java
@@ -1,8 +1,7 @@
-package com.sky.android_mvvm_basic_framework.ui;
+package com.sky.financelake.ui.activity;
import android.content.Intent;
import android.graphics.drawable.Animatable;
-import android.os.AsyncTask;
import android.os.Bundle;
import android.text.SpannableString;
import android.text.style.ForegroundColorSpan;
@@ -15,11 +14,11 @@ import android.widget.Toast;
import androidx.annotation.Nullable;
import androidx.lifecycle.ViewModelProvider;
-import com.sky.android_mvvm_basic_framework.base.BaseActivity;
-import com.sky.android_mvvm_basic_framework.databinding.ActivityKLineBinding;
-import com.sky.android_mvvm_basic_framework.model.dto.QuotationDto;
-import com.sky.android_mvvm_basic_framework.util.StockDataParser;
-import com.sky.android_mvvm_basic_framework.viewmodels.QuotationViewModel;
+import com.sky.financelake.base.BaseA;
+import com.sky.financelake.databinding.ActivityKLineBinding;
+import com.sky.financelake.bean.dto.QuotationDto;
+import com.sky.financelake.utils.StockDataParser;
+import com.sky.financelake.viewmodels.QuotationViewModel;
import com.wordplat.ikvstockchart.InteractiveKLineLayout;
import com.wordplat.ikvstockchart.KLineHandler;
import com.wordplat.ikvstockchart.R;
@@ -27,17 +26,15 @@ import com.wordplat.ikvstockchart.compat.PerformenceAnalyser;
import com.wordplat.ikvstockchart.entry.Entry;
import com.wordplat.ikvstockchart.entry.EntrySet;
import com.wordplat.ikvstockchart.entry.SizeColor;
-import com.wordplat.ikvstockchart.entry.StockDataTest;
import com.wordplat.ikvstockchart.render.KLineRender;
-import java.io.InputStream;
import java.util.ArrayList;
import java.util.List;
import dagger.hilt.android.AndroidEntryPoint;
@AndroidEntryPoint
-public class KLineA extends BaseActivity {
+public class KLineA extends BaseA {
private ActivityKLineBinding binding;
diff --git a/app/src/main/java/com/sky/financelake/ui/activity/MainA.java b/app/src/main/java/com/sky/financelake/ui/activity/MainA.java
new file mode 100644
index 0000000000000000000000000000000000000000..82f59dd09cf754c67f3412e417b4a6accad88801
--- /dev/null
+++ b/app/src/main/java/com/sky/financelake/ui/activity/MainA.java
@@ -0,0 +1,100 @@
+package com.sky.financelake.ui.activity;
+
+import android.os.Bundle;
+import android.view.MenuItem;
+
+import androidx.annotation.NonNull;
+import androidx.fragment.app.Fragment;
+
+import com.google.android.material.bottomnavigation.BottomNavigationView;
+import com.sky.financelake.R;
+import com.sky.financelake.base.BaseA;
+import com.sky.financelake.databinding.ActivityMainBinding;
+import com.sky.financelake.ui.fragment.ChooseF;
+import com.sky.financelake.ui.fragment.CommunityF;
+import com.sky.financelake.ui.fragment.HomeF;
+import com.sky.financelake.ui.fragment.MyF;
+
+import dagger.hilt.android.AndroidEntryPoint;
+
+@AndroidEntryPoint
+public class MainA extends BaseA {
+
+ private ActivityMainBinding binding;
+ private Fragment homeF, chooseF, communityF, myF, preFragment, curFragment;
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ binding = ActivityMainBinding.inflate(getLayoutInflater());
+ setContentView(binding.getRoot());
+
+ homeF = HomeF.newInstance();
+ chooseF = ChooseF.newInstance();
+ communityF = CommunityF.newInstance();
+ myF = MyF.newInstance();
+
+ initFragment();
+ BottomNavigationView navigationView = binding.navigationView;
+ navigationView.setOnNavigationItemSelectedListener(new BottomNavigationView.OnNavigationItemSelectedListener() {
+ @Override
+ public boolean onNavigationItemSelected(@NonNull MenuItem item) {
+
+ switch (item.getItemId()) {
+ case R.id.navigation_home:
+ curFragment = homeF;
+ break;
+
+ case R.id.navigation_choose:
+ curFragment = chooseF;
+ break;
+
+ case R.id.navigation_community:
+ curFragment = communityF;
+ break;
+
+ case R.id.navigation_my:
+ curFragment = myF;
+ break;
+ }
+ boolean status = loadFragment(preFragment, curFragment);
+ preFragment = curFragment;
+
+ return status;
+ }
+ });
+
+
+ }
+
+ public void initFragment() {
+ preFragment = homeF;
+ curFragment = homeF;
+ getSupportFragmentManager().beginTransaction()
+ .add(R.id.fragment_container, homeF)
+ .add(R.id.fragment_container, chooseF)
+ .add(R.id.fragment_container, communityF)
+ .add(R.id.fragment_container, myF)
+ .show(homeF)
+ .hide(chooseF)
+ .hide(communityF)
+ .hide(myF)
+ .commit();
+ }
+
+
+ private boolean loadFragment(Fragment o, Fragment n) {
+ //switching fragment
+ if (o != null && n != null) {
+ getSupportFragmentManager()
+ .beginTransaction()
+ .show(n)
+ .hide(o)
+ .commit();
+ return true;
+ }
+ return false;
+ }
+
+
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/sky/financelake/ui/activity/PdfViewA.java b/app/src/main/java/com/sky/financelake/ui/activity/PdfViewA.java
new file mode 100644
index 0000000000000000000000000000000000000000..c2716d982d4cdcaadcc8554f90934a9f97634dc0
--- /dev/null
+++ b/app/src/main/java/com/sky/financelake/ui/activity/PdfViewA.java
@@ -0,0 +1,158 @@
+package com.sky.financelake.ui.activity;
+
+import android.Manifest;
+import android.content.Context;
+import android.content.pm.PackageManager;
+import android.net.Uri;
+import android.os.AsyncTask;
+import android.os.Bundle;
+import android.os.Environment;
+import android.util.Log;
+
+import androidx.annotation.Nullable;
+import androidx.core.app.ActivityCompat;
+
+import com.github.barteksc.pdfviewer.PDFView;
+import com.github.barteksc.pdfviewer.listener.OnLoadCompleteListener;
+import com.sky.financelake.base.BaseA;
+import com.sky.financelake.databinding.ActivityPdfViewBinding;
+
+import java.io.BufferedInputStream;
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.net.URL;
+import java.net.URLConnection;
+
+import dagger.hilt.android.AndroidEntryPoint;
+
+@AndroidEntryPoint
+public class PdfViewA extends BaseA {
+
+ private ActivityPdfViewBinding binding;
+ private static final int PERMISSIONS_REQUEST_WRITE_EXTERNAL_STORAGE = 100;
+ PDFView pdfView;
+
+ @Override
+ protected void onCreate(@Nullable Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ binding = ActivityPdfViewBinding.inflate(getLayoutInflater());
+ setContentView(binding.getRoot());
+
+ pdfView = binding.pdfView;
+
+ Uri uri = Uri.parse("http://imeitu.oss-cn-beijing.aliyuncs.com/%E7%9F%A5%E8%AF%86%E4%BA%A7%E6%9D%83.pdf");
+
+
+ if (ActivityCompat.checkSelfPermission(PdfViewA.this, Manifest.permission.WRITE_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED
+ && ActivityCompat.checkSelfPermission(PdfViewA.this, Manifest.permission.WRITE_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED) {
+ ActivityCompat.requestPermissions(PdfViewA.this,
+ new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE},
+ PERMISSIONS_REQUEST_WRITE_EXTERNAL_STORAGE);
+ } else {
+ downloadFile();
+ }
+ }
+
+ @Override
+ public void onRequestPermissionsResult(int requestCode, String permissions[], int[] grantResults) {
+ switch (requestCode) {
+ case PERMISSIONS_REQUEST_WRITE_EXTERNAL_STORAGE:
+ downloadFile();
+ break;
+ }
+ }
+
+ private void downloadFile() {
+ DownloadFileTask task = new DownloadFileTask(
+ PdfViewA.this,
+ "http://imeitu.oss-cn-beijing.aliyuncs.com/%E7%9F%A5%E8%AF%86%E4%BA%A7%E6%9D%83.pdf",
+ "/download/pdf_file.pdf");
+ task.startTask();
+ }
+
+ public void onFileDownloaded() {
+ File file = new File(Environment.getExternalStorageDirectory().getAbsolutePath()
+ + "/download/pdf_file.pdf");
+ if (file.exists()) {
+ pdfView.fromFile(file)
+ //.pages(0, 2, 1, 3, 3, 3) // all pages are displayed by default
+ .enableSwipe(true)
+ .swipeHorizontal(true)
+ .enableDoubletap(true)
+ .defaultPage(0)
+ .enableAnnotationRendering(true)
+ .password(null)
+ .scrollHandle(null)
+ .onLoad(new OnLoadCompleteListener() {
+ @Override
+ public void loadComplete(int nbPages) {
+ pdfView.setMinZoom(1f);
+ pdfView.setMidZoom(5f);
+ pdfView.setMaxZoom(10f);
+ pdfView.zoomTo(2f);
+ pdfView.scrollTo(100, 0);
+ pdfView.moveTo(0f, 0f);
+ }
+ })
+ .load();
+
+ }
+ }
+
+ public class DownloadFileTask {
+ public static final String TAG = "DownloadFileTask";
+
+ private Context context;
+ private GetTask contentTask;
+ private String url;
+ private String fileName;
+
+ public DownloadFileTask(Context context, String url, String fileName) {
+ this.context = context;
+ this.url = url;
+ this.fileName = fileName;
+ }
+
+ public void startTask() {
+ doRequest();
+ }
+
+ private void doRequest() {
+ contentTask = new GetTask();
+ contentTask.execute();
+ }
+
+ private class GetTask extends AsyncTask {
+
+ @Override
+ protected String doInBackground(String... arg0) {
+ int count;
+ try {
+ Log.d(TAG, "url = " + url);
+ URL _url = new URL(url);
+ URLConnection conection = _url.openConnection();
+ conection.connect();
+ InputStream input = new BufferedInputStream(_url.openStream(), 8192);
+ OutputStream output = new FileOutputStream(
+ Environment.getExternalStorageDirectory() + fileName);
+ byte data[] = new byte[1024];
+ while ((count = input.read(data)) != -1) {
+ output.write(data, 0, count);
+ }
+ output.flush();
+ output.close();
+ input.close();
+ } catch (Exception e) {
+ Log.e("Error: ", e.getMessage());
+ }
+ return null;
+ }
+
+ protected void onPostExecute(String data) {
+ onFileDownloaded();
+ }
+ }
+ }
+}
diff --git a/app/src/main/java/com/sky/financelake/ui/activity/SplashScreenA.java b/app/src/main/java/com/sky/financelake/ui/activity/SplashScreenA.java
new file mode 100644
index 0000000000000000000000000000000000000000..9c168b0ca2e401a112d592423e6657be2d85579d
--- /dev/null
+++ b/app/src/main/java/com/sky/financelake/ui/activity/SplashScreenA.java
@@ -0,0 +1,83 @@
+package com.sky.financelake.ui.activity;
+
+import android.content.Intent;
+import android.os.Bundle;
+import android.os.CountDownTimer;
+import android.util.Log;
+import android.view.View;
+
+import androidx.annotation.Nullable;
+import androidx.appcompat.widget.AppCompatImageView;
+import androidx.appcompat.widget.AppCompatTextView;
+
+import com.bumptech.glide.Glide;
+import com.sky.financelake.base.BaseA;
+import com.sky.financelake.databinding.ActivitySplashScreenBinding;
+import com.sky.financelake.viewmodels.SplashViewModel;
+
+import dagger.hilt.android.AndroidEntryPoint;
+
+@AndroidEntryPoint
+public class SplashScreenA extends BaseA {
+
+ private ActivitySplashScreenBinding binding;
+ private SplashViewModel viewModel;
+ private CountDownTimer timer;
+ private static final String url = "https://imeitu.oss-cn-beijing.aliyuncs.com/financelake.png";
+
+ @Override
+ protected void onCreate(@Nullable Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ binding = ActivitySplashScreenBinding.inflate(getLayoutInflater());
+ setContentView(binding.getRoot());
+
+ AppCompatImageView ivSplash = binding.ivSplash;
+ AppCompatTextView tvTime = binding.tvTime;
+ tvTime.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ navigateActivity();
+ }
+ });
+
+ Glide.with(this).load(url).into(ivSplash);
+
+ timer = new CountDownTimer(3 * 1000, 1000) {
+ @Override
+ public void onTick(long millisUntilFinished) {
+ long second = millisUntilFinished / 1000;
+ Log.i(TAG, "onTick: " + second);
+ tvTime.setText(String.format("%s秒进入", second));
+ }
+
+ @Override
+ public void onFinish() {
+ navigateActivity();
+ }
+ };
+ timer.start();
+
+ }
+
+
+ private void navigateActivity() {
+ final Intent intent = new Intent(SplashScreenA.this, MainA.class);
+ intent.addFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION);
+ startActivity(intent);
+ finish();
+ }
+
+ @Override
+ public void onBackPressed() {
+ // We don't want the splash screen to be interrupted
+ }
+
+ @Override
+ protected void onDestroy() {
+ super.onDestroy();
+ if (timer != null) {
+ timer.cancel();
+ timer = null;
+ }
+ }
+}
diff --git a/app/src/main/java/com/sky/android_mvvm_basic_framework/ui/StockA.java b/app/src/main/java/com/sky/financelake/ui/activity/StockA.java
similarity index 69%
rename from app/src/main/java/com/sky/android_mvvm_basic_framework/ui/StockA.java
rename to app/src/main/java/com/sky/financelake/ui/activity/StockA.java
index 5b474b070c29748d6a684c528ad2e91dbf909f5e..415ad19ed00cff0f55cd35082be7fce373f444c3 100644
--- a/app/src/main/java/com/sky/android_mvvm_basic_framework/ui/StockA.java
+++ b/app/src/main/java/com/sky/financelake/ui/activity/StockA.java
@@ -1,4 +1,4 @@
-package com.sky.android_mvvm_basic_framework.ui;
+package com.sky.financelake.ui.activity;
import android.content.Intent;
import android.os.Bundle;
@@ -9,12 +9,12 @@ import androidx.lifecycle.ViewModelProvider;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
-import com.sky.android_mvvm_basic_framework.adapter.StockAdapter;
-import com.sky.android_mvvm_basic_framework.base.BaseActivity;
-import com.sky.android_mvvm_basic_framework.databinding.ActivityStockBinding;
-import com.sky.android_mvvm_basic_framework.model.dto.StockDto;
-import com.sky.android_mvvm_basic_framework.model.param.StockParam;
-import com.sky.android_mvvm_basic_framework.viewmodels.StockViewModel;
+import com.sky.financelake.adapter.StockAdapter;
+import com.sky.financelake.base.BaseA;
+import com.sky.financelake.databinding.ActivityStockBinding;
+import com.sky.financelake.bean.dto.StockDto;
+import com.sky.financelake.bean.param.StockParam;
+import com.sky.financelake.viewmodels.StockViewModel;
import java.util.ArrayList;
import java.util.List;
@@ -22,10 +22,10 @@ import java.util.List;
import dagger.hilt.android.AndroidEntryPoint;
@AndroidEntryPoint
-public class StockA extends BaseActivity {
+public class StockA extends BaseA {
private ActivityStockBinding binding;
- private StockAdapter adapter;
+ private StockAdapter mStockAdapter;
private final List stockDtos = new ArrayList<>();
private StockViewModel mViewModel;
@@ -39,8 +39,8 @@ public class StockA extends BaseActivity {
RecyclerView recyclerView = binding.recyclerView;
recyclerView.setLayoutManager(new LinearLayoutManager(this));
- adapter = new StockAdapter(stockDtos, this);
- adapter.setOnItemClickListener(new StockAdapter.OnItemClickListener() {
+ mStockAdapter = new StockAdapter(stockDtos, this);
+ mStockAdapter.setOnItemClickListener(new StockAdapter.OnItemClickListener() {
@Override
public void onClick(int position) {
String code = stockDtos.get(position).getSymbol();
@@ -49,13 +49,13 @@ public class StockA extends BaseActivity {
startActivity(intent);
}
});
- recyclerView.setAdapter(adapter);
+ recyclerView.setAdapter(mStockAdapter);
mViewModel = new ViewModelProvider(this).get(StockViewModel.class);
mViewModel.getStockListLiveData().observe(this, response -> {
List tmp = response.getResult();
stockDtos.addAll(tmp);
- adapter.notifyDataSetChanged();
+ mStockAdapter.notifyDataSetChanged();
});
loadData();
}
diff --git a/app/src/main/java/com/sky/android_mvvm_basic_framework/ui/StockDetailA.java b/app/src/main/java/com/sky/financelake/ui/activity/StockDetailA.java
similarity index 74%
rename from app/src/main/java/com/sky/android_mvvm_basic_framework/ui/StockDetailA.java
rename to app/src/main/java/com/sky/financelake/ui/activity/StockDetailA.java
index 66e92841e7edfb45d4bc395ac800c44fc08defef..2ccffb39c38105ecf77a420cef142db6654b6e11 100644
--- a/app/src/main/java/com/sky/android_mvvm_basic_framework/ui/StockDetailA.java
+++ b/app/src/main/java/com/sky/financelake/ui/activity/StockDetailA.java
@@ -1,4 +1,4 @@
-package com.sky.android_mvvm_basic_framework.ui;
+package com.sky.financelake.ui.activity;
import android.os.Bundle;
@@ -6,14 +6,14 @@ import androidx.annotation.Nullable;
import androidx.appcompat.widget.AppCompatTextView;
import androidx.lifecycle.ViewModelProvider;
-import com.sky.android_mvvm_basic_framework.base.BaseActivity;
-import com.sky.android_mvvm_basic_framework.databinding.ActivityStockDetailBinding;
-import com.sky.android_mvvm_basic_framework.viewmodels.StockDetailViewModel;
+import com.sky.financelake.base.BaseA;
+import com.sky.financelake.databinding.ActivityStockDetailBinding;
+import com.sky.financelake.viewmodels.StockDetailViewModel;
import dagger.hilt.android.AndroidEntryPoint;
@AndroidEntryPoint
-public class StockDetailA extends BaseActivity {
+public class StockDetailA extends BaseA {
private ActivityStockDetailBinding binding;
private StockDetailViewModel viewModel;
diff --git a/app/src/main/java/com/sky/financelake/ui/activity/TabA.java b/app/src/main/java/com/sky/financelake/ui/activity/TabA.java
new file mode 100644
index 0000000000000000000000000000000000000000..b4ef048d7998325337b87192861bd6690d34577c
--- /dev/null
+++ b/app/src/main/java/com/sky/financelake/ui/activity/TabA.java
@@ -0,0 +1,82 @@
+package com.sky.financelake.ui.activity;
+
+import android.os.Bundle;
+import android.widget.Toast;
+
+import androidx.annotation.NonNull;
+import androidx.fragment.app.Fragment;
+import androidx.viewpager2.widget.ViewPager2;
+
+import com.google.android.material.tabs.TabLayout;
+import com.google.android.material.tabs.TabLayoutMediator;
+import com.sky.financelake.R;
+import com.sky.financelake.adapter.CommunityTabAdapter;
+import com.sky.financelake.base.BaseA;
+import com.sky.financelake.databinding.ActivityTestBinding;
+import com.sky.financelake.ui.fragment.community.BarF;
+import com.sky.financelake.ui.fragment.community.SkillF;
+import com.sky.financelake.ui.fragment.community.TalkF;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import dagger.hilt.android.AndroidEntryPoint;
+
+@AndroidEntryPoint
+public class TabA extends BaseA {
+
+
+ private ActivityTestBinding binding;
+ private ViewPager2 viewPager2;
+ private TabLayout tabLayout;
+ private CommunityTabAdapter adapter;
+ private List fragments = new ArrayList<>();
+ private String[] tabs ;
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ binding = ActivityTestBinding.inflate(getLayoutInflater());
+ setContentView(binding.getRoot());
+
+ tabs = getResources().getStringArray(R.array.community_tabs);
+
+ fragments.add(SkillF.newInstance());
+ fragments.add(BarF.newInstance());
+ fragments.add(TalkF.newInstance());
+
+ viewPager2 = binding.viewPager2;
+ tabLayout = binding.tabs;
+
+ adapter = new CommunityTabAdapter(TabA.this,fragments);
+ viewPager2.setAdapter(adapter);
+
+ viewPager2.registerOnPageChangeCallback(new ViewPager2.OnPageChangeCallback() {
+ @Override
+ public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
+ super.onPageScrolled(position, positionOffset, positionOffsetPixels);
+ }
+
+ @Override
+ public void onPageSelected(int position) {
+ super.onPageSelected(position);
+ Toast.makeText(TabA.this, ""+position, Toast.LENGTH_SHORT).show();
+ }
+ });
+
+ TabLayoutMediator tm = new TabLayoutMediator(tabLayout, viewPager2, new TabLayoutMediator.TabConfigurationStrategy() {
+ @Override
+ public void onConfigureTab(@NonNull TabLayout.Tab tab, int position) {
+ tab.setText(tabs[position]);
+ }
+ });
+ tm.attach();
+
+ }
+
+ private void initUI() {
+
+
+ }
+
+}
diff --git a/app/src/main/java/com/sky/financelake/ui/fragment/ChooseF.java b/app/src/main/java/com/sky/financelake/ui/fragment/ChooseF.java
new file mode 100644
index 0000000000000000000000000000000000000000..2cae6758300693d103c0eb40eed230289c3caa6c
--- /dev/null
+++ b/app/src/main/java/com/sky/financelake/ui/fragment/ChooseF.java
@@ -0,0 +1,44 @@
+package com.sky.financelake.ui.fragment;
+
+import android.os.Bundle;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+
+import androidx.annotation.NonNull;
+import androidx.annotation.Nullable;
+
+import com.sky.financelake.base.BaseF;
+import com.sky.financelake.databinding.FragmentChooseBinding;
+import com.sky.financelake.utils.LoadingUtil;
+
+import dagger.hilt.android.AndroidEntryPoint;
+
+@AndroidEntryPoint
+public class ChooseF extends BaseF {
+
+
+ private FragmentChooseBinding binding;
+ private LoadingUtil loadingUtil;
+
+ public static class SingleHolder {
+ private static ChooseF instance = new ChooseF();
+ }
+
+ private ChooseF() {
+ }
+
+ public static ChooseF newInstance() {
+ return SingleHolder.instance;
+ }
+
+ @Nullable
+ @Override
+ public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
+ binding = FragmentChooseBinding.inflate(getLayoutInflater());
+ loadingUtil = LoadingUtil.newInstance(binding.getRoot());
+
+
+ return binding.getRoot();
+ }
+}
diff --git a/app/src/main/java/com/sky/financelake/ui/fragment/CommunityF.java b/app/src/main/java/com/sky/financelake/ui/fragment/CommunityF.java
new file mode 100644
index 0000000000000000000000000000000000000000..2aee1034232998faac1e3952853e1f8034bc60de
--- /dev/null
+++ b/app/src/main/java/com/sky/financelake/ui/fragment/CommunityF.java
@@ -0,0 +1,105 @@
+package com.sky.financelake.ui.fragment;
+
+import android.os.Bundle;
+import android.util.Log;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.Toast;
+
+import androidx.annotation.NonNull;
+import androidx.annotation.Nullable;
+import androidx.fragment.app.Fragment;
+import androidx.viewpager2.widget.ViewPager2;
+
+import com.google.android.material.tabs.TabLayout;
+import com.google.android.material.tabs.TabLayoutMediator;
+import com.sky.financelake.R;
+import com.sky.financelake.adapter.CommunityTabAdapter;
+import com.sky.financelake.base.BaseF;
+import com.sky.financelake.databinding.FragmentCommunityBinding;
+import com.sky.financelake.ui.fragment.community.BarF;
+import com.sky.financelake.ui.fragment.community.SkillF;
+import com.sky.financelake.ui.fragment.community.TalkF;
+import com.sky.financelake.utils.LoadingUtil;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import dagger.hilt.android.AndroidEntryPoint;
+
+@AndroidEntryPoint
+public class CommunityF extends BaseF {
+
+
+ private FragmentCommunityBinding binding;
+ private LoadingUtil loadingUtil;
+
+ private ViewPager2 viewPager2;
+ private TabLayout tabLayout;
+ private CommunityTabAdapter adapter;
+ private List fragments = new ArrayList<>();
+ private String[] tabs;
+
+ private TabLayoutMediator tm;
+
+ public static class SingleHolder {
+ private static CommunityF instance = new CommunityF();
+ }
+
+ private CommunityF() {
+ }
+
+ public static CommunityF newInstance() {
+ return SingleHolder.instance;
+ }
+
+ @Nullable
+ @Override
+ public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
+ Log.i(TAG, "onCreateView: ");
+ binding = FragmentCommunityBinding.inflate(getLayoutInflater());
+ loadingUtil = LoadingUtil.newInstance(binding.getRoot());
+
+ tabs = getResources().getStringArray(R.array.community_tabs);
+
+ fragments.add(SkillF.newInstance());
+ fragments.add(BarF.newInstance());
+ fragments.add(TalkF.newInstance());
+
+ viewPager2 = binding.viewPager2;
+ tabLayout = binding.tabs;
+
+ adapter = new CommunityTabAdapter(requireActivity(), fragments);
+ viewPager2.setAdapter(adapter);
+
+ viewPager2.registerOnPageChangeCallback(new ViewPager2.OnPageChangeCallback() {
+ @Override
+ public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
+ super.onPageScrolled(position, positionOffset, positionOffsetPixels);
+ }
+
+ @Override
+ public void onPageSelected(int position) {
+ super.onPageSelected(position);
+ }
+ });
+
+ tm = new TabLayoutMediator(tabLayout, viewPager2, new TabLayoutMediator.TabConfigurationStrategy() {
+ @Override
+ public void onConfigureTab(@NonNull TabLayout.Tab tab, int position) {
+ tab.setText(tabs[position]);
+ }
+ });
+ tm.attach();
+
+
+ return binding.getRoot();
+ }
+
+ @Override
+ public void onDestroy() {
+ super.onDestroy();
+ tm.detach();
+ }
+}
diff --git a/app/src/main/java/com/sky/financelake/ui/fragment/HomeF.java b/app/src/main/java/com/sky/financelake/ui/fragment/HomeF.java
new file mode 100644
index 0000000000000000000000000000000000000000..ae892538e9b9a41e5a9c5ec872ff65c4a64cd879
--- /dev/null
+++ b/app/src/main/java/com/sky/financelake/ui/fragment/HomeF.java
@@ -0,0 +1,53 @@
+package com.sky.financelake.ui.fragment;
+
+import android.content.Intent;
+import android.os.Bundle;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+
+import androidx.annotation.NonNull;
+import androidx.annotation.Nullable;
+import androidx.appcompat.widget.AppCompatButton;
+
+import com.sky.financelake.base.BaseF;
+import com.sky.financelake.databinding.FragmentHomeBinding;
+import com.sky.financelake.ui.activity.PdfViewA;
+import com.sky.financelake.utils.LoadingUtil;
+
+import dagger.hilt.android.AndroidEntryPoint;
+
+@AndroidEntryPoint
+public class HomeF extends BaseF {
+
+ private FragmentHomeBinding binding;
+ private LoadingUtil loadingUtil;
+
+ public static class SingleHolder {
+ private static HomeF instance = new HomeF();
+ }
+
+ private HomeF(){}
+
+ public static HomeF newInstance() {
+ return SingleHolder.instance;
+ }
+
+ @Nullable
+ @Override
+ public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
+ binding = FragmentHomeBinding.inflate(getLayoutInflater());
+ loadingUtil = LoadingUtil.newInstance(binding.getRoot());
+
+ AppCompatButton btnPre = binding.btnPreview;
+ btnPre.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ startActivity(new Intent(requireContext(), PdfViewA.class));
+ }
+ });
+
+
+ return binding.getRoot();
+ }
+}
diff --git a/app/src/main/java/com/sky/financelake/ui/fragment/MyF.java b/app/src/main/java/com/sky/financelake/ui/fragment/MyF.java
new file mode 100644
index 0000000000000000000000000000000000000000..a8b5876c130b0441de826d329c6ca0b6771ae058
--- /dev/null
+++ b/app/src/main/java/com/sky/financelake/ui/fragment/MyF.java
@@ -0,0 +1,39 @@
+package com.sky.financelake.ui.fragment;
+
+import android.os.Bundle;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+
+import androidx.annotation.NonNull;
+import androidx.annotation.Nullable;
+
+import com.sky.financelake.base.BaseF;
+import com.sky.financelake.databinding.FragmentMyBinding;
+
+import dagger.hilt.android.AndroidEntryPoint;
+
+@AndroidEntryPoint
+public class MyF extends BaseF {
+
+
+ private FragmentMyBinding binding;
+
+ public static class SingleHolder {
+ private static MyF instance = new MyF();
+ }
+
+ private MyF() {
+ }
+
+ public static MyF newInstance() {
+ return SingleHolder.instance;
+ }
+
+ @Nullable
+ @Override
+ public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
+ binding = FragmentMyBinding.inflate(getLayoutInflater());
+ return binding.getRoot();
+ }
+}
diff --git a/app/src/main/java/com/sky/financelake/ui/fragment/community/BarF.java b/app/src/main/java/com/sky/financelake/ui/fragment/community/BarF.java
new file mode 100644
index 0000000000000000000000000000000000000000..4a16d02255097e861e5ff37d2c51f36b4d96c5ef
--- /dev/null
+++ b/app/src/main/java/com/sky/financelake/ui/fragment/community/BarF.java
@@ -0,0 +1,36 @@
+package com.sky.financelake.ui.fragment.community;
+
+import android.os.Bundle;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+
+import androidx.annotation.NonNull;
+import androidx.annotation.Nullable;
+
+import com.sky.financelake.base.BaseF;
+import com.sky.financelake.databinding.FragmentCommunityBarBinding;
+import com.sky.financelake.databinding.FragmentCommunitySkillBinding;
+
+import dagger.hilt.android.AndroidEntryPoint;
+
+@AndroidEntryPoint
+public class BarF extends BaseF {
+
+ private FragmentCommunityBarBinding binding;
+
+ public BarF(){}
+
+ public static BarF newInstance(){
+ BarF barF = new BarF();
+ return barF;
+ }
+
+ @Nullable
+ @Override
+ public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
+ binding = FragmentCommunityBarBinding.inflate(getLayoutInflater());
+
+ return binding.getRoot();
+ }
+}
diff --git a/app/src/main/java/com/sky/financelake/ui/fragment/community/SkillF.java b/app/src/main/java/com/sky/financelake/ui/fragment/community/SkillF.java
new file mode 100644
index 0000000000000000000000000000000000000000..8a9078d2ddd9c0da28eb540e2337043e37491edc
--- /dev/null
+++ b/app/src/main/java/com/sky/financelake/ui/fragment/community/SkillF.java
@@ -0,0 +1,125 @@
+package com.sky.financelake.ui.fragment.community;
+
+import android.content.Intent;
+import android.os.Bundle;
+import android.util.Log;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+
+import androidx.annotation.NonNull;
+import androidx.annotation.Nullable;
+import androidx.lifecycle.ViewModelProvider;
+import androidx.recyclerview.widget.LinearLayoutManager;
+import androidx.recyclerview.widget.RecyclerView;
+import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
+
+import com.google.android.material.snackbar.Snackbar;
+import com.sky.financelake.R;
+import com.sky.financelake.adapter.BaseAdapter;
+import com.sky.financelake.adapter.CommunitySkillAdapter;
+import com.sky.financelake.base.BaseF;
+import com.sky.financelake.bean.dto.CommunityDto;
+import com.sky.financelake.databinding.FragmentCommunitySkillBinding;
+import com.sky.financelake.ui.activity.CommunityDetailA;
+import com.sky.financelake.ui.wigets.EndlessRecyclerOnScrollListener;
+import com.sky.financelake.utils.LoadingUtil;
+import com.sky.financelake.viewmodels.CommunityViewModel;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import dagger.hilt.android.AndroidEntryPoint;
+
+@AndroidEntryPoint
+public class SkillF extends BaseF {
+
+ private FragmentCommunitySkillBinding binding;
+ private CommunitySkillAdapter mSkillAdapter;
+ private LoadingUtil loadingUtil;
+ private CommunityViewModel mCommunityViewModel;
+ private Integer curPage = 1;
+ private List communityDtos = new ArrayList<>();
+ private SwipeRefreshLayout refreshLayout;
+
+
+ public SkillF() {
+ }
+
+ public static SkillF newInstance() {
+ SkillF skillF = new SkillF();
+ return skillF;
+ }
+
+ @Nullable
+ @Override
+ public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup viewGroup, @Nullable Bundle savedInstanceState) {
+ Log.i(TAG, "onCreateView: ");
+ binding = FragmentCommunitySkillBinding.inflate(getLayoutInflater());
+ loadingUtil = LoadingUtil.newInstance(binding.getRoot());
+
+ mCommunityViewModel = new ViewModelProvider(requireActivity()).get(CommunityViewModel.class);
+
+
+ refreshLayout = binding.refreshLayout;
+ refreshLayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
+ @Override
+ public void onRefresh() {
+ load(true);
+ }
+ });
+
+ final RecyclerView rvSkill = binding.rvSkill;
+
+ mSkillAdapter = new CommunitySkillAdapter(requireActivity(), communityDtos);
+ mSkillAdapter.setOnItemClickListener(new BaseAdapter.OnItemClickListener() {
+ @Override
+ public void onClick(Integer position, Object o) {
+ CommunityDto communityDto = (CommunityDto) o;
+ Intent intent = new Intent(requireActivity(), CommunityDetailA.class);
+ intent.putExtra("id", communityDto.id);
+ intent.putExtra("title", communityDto.title);
+ startActivity(intent);
+ }
+ });
+ rvSkill.setLayoutManager(new LinearLayoutManager(getContext()));
+ rvSkill.addOnScrollListener(new EndlessRecyclerOnScrollListener() {
+ @Override
+ public void onLoadMore() {
+ Log.i(TAG, "onLoadMore: 加载");
+ if (mSkillAdapter.getStatus() != BaseAdapter.LOADING_END) {
+ load(false);
+ }
+ }
+ });
+ rvSkill.setAdapter(mSkillAdapter);
+ load(true);
+ return binding.getRoot();
+ }
+
+ public void load(boolean isRefresh) {
+ if (isRefresh) {
+ curPage = 1;
+ }
+ mCommunityViewModel.getCommunityPagingList(0, curPage).observe(this, body -> {
+ refreshLayout.setRefreshing(false);
+ if (body != null) {
+ List tmp = (List) body.getResult();
+ if (tmp.size() == 0) {
+ mSkillAdapter.setStatus(BaseAdapter.LOADING_END);
+ } else {
+ if (isRefresh) {
+ communityDtos.clear();
+ }
+ curPage++;
+ communityDtos.addAll(tmp);
+ mSkillAdapter.notifyDataSetChanged();
+ }
+ } else {
+ Snackbar.make(refreshLayout, R.string.api_error, 500);
+ }
+
+ });
+ }
+
+}
diff --git a/app/src/main/java/com/sky/financelake/ui/fragment/community/TalkF.java b/app/src/main/java/com/sky/financelake/ui/fragment/community/TalkF.java
new file mode 100644
index 0000000000000000000000000000000000000000..15e36829a3ece6329d3ae0d02a0312783188e1df
--- /dev/null
+++ b/app/src/main/java/com/sky/financelake/ui/fragment/community/TalkF.java
@@ -0,0 +1,36 @@
+package com.sky.financelake.ui.fragment.community;
+
+import android.os.Bundle;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+
+import androidx.annotation.NonNull;
+import androidx.annotation.Nullable;
+
+import com.sky.financelake.base.BaseF;
+import com.sky.financelake.databinding.FragmentCommunitySkillBinding;
+import com.sky.financelake.databinding.FragmentCommunityTalkBinding;
+
+import dagger.hilt.android.AndroidEntryPoint;
+
+@AndroidEntryPoint
+public class TalkF extends BaseF {
+
+ private FragmentCommunityTalkBinding binding;
+
+ public TalkF(){}
+
+ public static TalkF newInstance(){
+ TalkF talkF = new TalkF();
+ return talkF;
+ }
+
+ @Nullable
+ @Override
+ public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
+ binding = FragmentCommunityTalkBinding.inflate(getLayoutInflater());
+
+ return binding.getRoot();
+ }
+}
diff --git a/app/src/main/java/com/sky/financelake/ui/wigets/EndlessRecyclerOnScrollListener.java b/app/src/main/java/com/sky/financelake/ui/wigets/EndlessRecyclerOnScrollListener.java
new file mode 100644
index 0000000000000000000000000000000000000000..255ec1d3b0337791239b2fa94ba3c90e3b59fad1
--- /dev/null
+++ b/app/src/main/java/com/sky/financelake/ui/wigets/EndlessRecyclerOnScrollListener.java
@@ -0,0 +1,40 @@
+package com.sky.financelake.ui.wigets;
+
+import androidx.recyclerview.widget.LinearLayoutManager;
+import androidx.recyclerview.widget.RecyclerView;
+
+public abstract class EndlessRecyclerOnScrollListener extends RecyclerView.OnScrollListener {
+
+ //用来标记是否正在向上滑动
+ private boolean isSlidingUpward = false;
+
+ @Override
+ public void onScrollStateChanged(RecyclerView recyclerView, int newState) {
+ super.onScrollStateChanged(recyclerView, newState);
+ LinearLayoutManager manager = (LinearLayoutManager) recyclerView.getLayoutManager();
+ // 当不滑动时
+ if (newState == RecyclerView.SCROLL_STATE_IDLE) {
+ //获取最后一个完全显示的itemPosition
+ int lastItemPosition = manager.findLastCompletelyVisibleItemPosition();
+ int itemCount = manager.getItemCount();
+
+ // 判断是否滑动到了最后一个item,并且是向上滑动
+ if (lastItemPosition == (itemCount - 1) && isSlidingUpward) {
+ //加载更多
+ onLoadMore();
+ }
+ }
+ }
+
+ @Override
+ public void onScrolled(RecyclerView recyclerView, int dx, int dy) {
+ super.onScrolled(recyclerView, dx, dy);
+ // 大于0表示正在向上滑动,小于等于0表示停止或向下滑动
+ isSlidingUpward = dy > 0;
+ }
+
+ /**
+ * 加载更多回调
+ */
+ public abstract void onLoadMore();
+}
diff --git a/app/src/main/java/com/sky/financelake/ui/wigets/SingleLiveEvent.java b/app/src/main/java/com/sky/financelake/ui/wigets/SingleLiveEvent.java
new file mode 100644
index 0000000000000000000000000000000000000000..d198fc3af5f69b08b39586b46a10febf58305945
--- /dev/null
+++ b/app/src/main/java/com/sky/financelake/ui/wigets/SingleLiveEvent.java
@@ -0,0 +1,39 @@
+package com.sky.financelake.ui.wigets;
+
+import androidx.annotation.MainThread;
+import androidx.annotation.NonNull;
+import androidx.annotation.Nullable;
+import androidx.lifecycle.LifecycleOwner;
+import androidx.lifecycle.MutableLiveData;
+import androidx.lifecycle.Observer;
+
+import java.util.concurrent.atomic.AtomicBoolean;
+
+public class SingleLiveEvent extends MutableLiveData {
+ private final AtomicBoolean mPending = new AtomicBoolean(false);
+ @Override
+ public void observe(@NonNull LifecycleOwner owner, @NonNull final Observer super T> observer) {
+ super.observe(owner, new Observer() {
+ @Override
+ public void onChanged(@Nullable T t) {
+ if (mPending.compareAndSet(true, false)) {
+ observer.onChanged(t);
+ }
+ }
+ });
+ }
+
+ @MainThread
+ public void setValue(@Nullable T t) {
+ mPending.set(true);
+ super.setValue(t);
+ }
+
+ /**
+ * Used for cases where T is Void, to make calls cleaner.
+ */
+ @MainThread
+ public void call() {
+ setValue(null);
+ }
+}
diff --git a/app/src/main/java/com/sky/financelake/utils/LoadingUtil.java b/app/src/main/java/com/sky/financelake/utils/LoadingUtil.java
new file mode 100644
index 0000000000000000000000000000000000000000..74873f1e7612c8b3d03094ad11cb8bacd57c5049
--- /dev/null
+++ b/app/src/main/java/com/sky/financelake/utils/LoadingUtil.java
@@ -0,0 +1,122 @@
+package com.sky.financelake.utils;
+
+import android.app.Activity;
+import android.view.View;
+import android.widget.TextView;
+
+import androidx.appcompat.widget.AppCompatTextView;
+
+import com.facebook.shimmer.ShimmerFrameLayout;
+import com.sky.financelake.R;
+
+/**
+ * @author : 陈欣健
+ * @describe :
+ * @since :2016-09-10 下午6:37
+ **/
+public class LoadingUtil {
+ private Activity activity;
+ private View view;
+
+ public static LoadingUtil newInstance(View view) {
+ return new LoadingUtil(view);
+ }
+
+ public static LoadingUtil newInstance(Activity activity) {
+ return new LoadingUtil(activity);
+ }
+
+ private LoadingUtil(Activity activity) {
+ this.activity = activity;
+ initLoading(activity);
+ }
+
+ private LoadingUtil(View view) {
+ this.view = view;
+ initLoading(view);
+ }
+
+
+ ShimmerFrameLayout shimmer = null;
+ AppCompatTextView tvShimmer, tvReload, tvNone;
+
+ protected void initLoading(View view) {
+ shimmer = view.findViewById(R.id.shimmer_container);
+ tvShimmer = (AppCompatTextView) view.findViewById(R.id.tv_shimmer);
+ tvReload = (AppCompatTextView) view.findViewById(R.id.btn_reload);
+ tvNone = (AppCompatTextView) view.findViewById(R.id.tv_none);
+ startShimmer();
+ }
+
+ protected void initLoading(Activity activity) {
+ shimmer = view.findViewById(R.id.shimmer_container);
+ tvShimmer = (AppCompatTextView) activity.findViewById(R.id.tv_shimmer);
+ tvReload = (AppCompatTextView) activity.findViewById(R.id.btn_reload);
+ tvNone = (AppCompatTextView) activity.findViewById(R.id.tv_none);
+ startShimmer();
+ }
+
+ private void startShimmer() {
+ if (shimmer != null && tvShimmer != null) {
+ shimmer.startShimmer();
+ }
+ }
+
+ public void showLoading() {
+ hide();
+ if (tvShimmer != null && shimmer != null) {
+ tvShimmer.setVisibility(View.VISIBLE);
+ shimmer.startShimmer();
+ }
+ }
+
+ public void hideLoading() {
+ if (shimmer != null && tvShimmer != null) {
+ if (tvShimmer.getVisibility() == View.VISIBLE) {
+ shimmer.stopShimmer();
+ tvShimmer.setVisibility(View.GONE);
+ }
+ }
+ }
+
+ TextView tv_reload = null;
+
+ public void showReload(View.OnClickListener clickListener) {
+ hide();
+ if (tvReload != null) {
+ tvReload.setVisibility(View.VISIBLE);
+ if (clickListener != null) {
+ tvReload.setOnClickListener(clickListener);
+ }
+ }
+ }
+
+ TextView tv_none = null;
+
+ public void showNone() {
+ hide();
+ if (tvNone != null) {
+ tvNone.setVisibility(View.VISIBLE);
+ }
+ }
+
+ public void hideNone() {
+ if (tvNone != null) {
+ tvNone.setVisibility(View.GONE);
+ }
+ }
+
+ public void hide() {
+ hideLoading();
+ hideReload();
+ hideNone();
+ }
+
+ public void hideReload() {
+ if (tvReload != null && tvReload.getVisibility() == View.VISIBLE) {
+ tvReload.setVisibility(View.GONE);
+
+ }
+ }
+
+}
diff --git a/app/src/main/java/com/sky/android_mvvm_basic_framework/util/StockDataParser.java b/app/src/main/java/com/sky/financelake/utils/StockDataParser.java
similarity index 86%
rename from app/src/main/java/com/sky/android_mvvm_basic_framework/util/StockDataParser.java
rename to app/src/main/java/com/sky/financelake/utils/StockDataParser.java
index 39d4dcfa29330d297b03b64e76e8a15abefba336..ac22ecc7d701775f95a8921cb8dc947e97fcefa0 100644
--- a/app/src/main/java/com/sky/android_mvvm_basic_framework/util/StockDataParser.java
+++ b/app/src/main/java/com/sky/financelake/utils/StockDataParser.java
@@ -1,6 +1,6 @@
-package com.sky.android_mvvm_basic_framework.util;
+package com.sky.financelake.utils;
-import com.sky.android_mvvm_basic_framework.model.dto.QuotationDto;
+import com.sky.financelake.bean.dto.QuotationDto;
import com.wordplat.ikvstockchart.entry.Entry;
import com.wordplat.ikvstockchart.entry.EntrySet;
diff --git a/app/src/main/java/com/sky/android_mvvm_basic_framework/viewmodels/BaseViewModel.java b/app/src/main/java/com/sky/financelake/viewmodels/BaseViewModel.java
similarity index 77%
rename from app/src/main/java/com/sky/android_mvvm_basic_framework/viewmodels/BaseViewModel.java
rename to app/src/main/java/com/sky/financelake/viewmodels/BaseViewModel.java
index 5ef8bf67e1f6ab55aca545b32677ebaef40dbf2a..42de72027c5bcf19078f8f850c0209e4bf5628cd 100644
--- a/app/src/main/java/com/sky/android_mvvm_basic_framework/viewmodels/BaseViewModel.java
+++ b/app/src/main/java/com/sky/financelake/viewmodels/BaseViewModel.java
@@ -1,20 +1,13 @@
-package com.sky.android_mvvm_basic_framework.viewmodels;
+package com.sky.financelake.viewmodels;
-import android.app.Activity;
import android.content.Context;
-import android.content.Intent;
import androidx.annotation.NonNull;
import androidx.coordinatorlayout.widget.CoordinatorLayout;
-import androidx.lifecycle.LiveData;
import androidx.lifecycle.ViewModel;
import com.google.android.material.snackbar.Snackbar;
-import com.sky.android_mvvm_basic_framework.R;
-
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Queue;
+import com.sky.financelake.R;
/**
* abstract base class for ViewModels
diff --git a/app/src/main/java/com/sky/financelake/viewmodels/CommunityViewModel.java b/app/src/main/java/com/sky/financelake/viewmodels/CommunityViewModel.java
new file mode 100644
index 0000000000000000000000000000000000000000..4277928d17e583fc2b46cba276a8d6c0deafc8be
--- /dev/null
+++ b/app/src/main/java/com/sky/financelake/viewmodels/CommunityViewModel.java
@@ -0,0 +1,56 @@
+package com.sky.financelake.viewmodels;
+
+import android.util.Log;
+
+import com.sky.financelake.bean.dto.CommunityDto;
+import com.sky.financelake.bean.entity.CommunityEntity;
+import com.sky.financelake.bean.param.CommunityParam;
+import com.sky.financelake.retrofit.ApiResponse;
+import com.sky.financelake.retrofit.CommunityRepository;
+import com.sky.financelake.ui.wigets.SingleLiveEvent;
+
+import java.util.List;
+
+public class CommunityViewModel extends BaseViewModel {
+ private SingleLiveEvent>> pageLd;
+ private SingleLiveEvent> detailLd;
+
+ private CommunityRepository communityRepository;
+
+ public CommunityViewModel() {
+ communityRepository = CommunityRepository.getInstance();
+ }
+
+ public CommunityRepository getCommunityRepository() {
+ return communityRepository;
+ }
+
+ public SingleLiveEvent>> getPageLiveData() {
+ if (pageLd == null) {
+ pageLd = new SingleLiveEvent>>();
+ }
+ return pageLd;
+ }
+
+ public SingleLiveEvent> getDetailLiveData() {
+ if (detailLd == null) {
+ detailLd = new SingleLiveEvent>();
+ }
+ return detailLd;
+ }
+
+
+ public SingleLiveEvent>> getCommunityPagingList(int type, int pageNo) {
+ Log.i(TAG, "getCommunityPagingList: ");
+ CommunityParam param = new CommunityParam();
+ param.setType(type);
+ param.setPageNo(pageNo);
+ communityRepository.getCommunityPagingList(getPageLiveData(), param);
+ return pageLd;
+ }
+
+ public SingleLiveEvent> getCommunityById(Integer id) {
+ communityRepository.getCommunityById(getDetailLiveData(), id);
+ return detailLd;
+ }
+}
diff --git a/app/src/main/java/com/sky/android_mvvm_basic_framework/viewmodels/QuotationViewModel.java b/app/src/main/java/com/sky/financelake/viewmodels/QuotationViewModel.java
similarity index 78%
rename from app/src/main/java/com/sky/android_mvvm_basic_framework/viewmodels/QuotationViewModel.java
rename to app/src/main/java/com/sky/financelake/viewmodels/QuotationViewModel.java
index 8b01d7efd78c0b04b683010a49cc76a9bae0464a..8acd20b235a9d94f678611cc502af9a09ce7f69a 100644
--- a/app/src/main/java/com/sky/android_mvvm_basic_framework/viewmodels/QuotationViewModel.java
+++ b/app/src/main/java/com/sky/financelake/viewmodels/QuotationViewModel.java
@@ -1,11 +1,11 @@
-package com.sky.android_mvvm_basic_framework.viewmodels;
+package com.sky.financelake.viewmodels;
import androidx.lifecycle.LiveData;
import androidx.lifecycle.MutableLiveData;
-import com.sky.android_mvvm_basic_framework.model.dto.QuotationDto;
-import com.sky.android_mvvm_basic_framework.retrofit.ApiResponse;
-import com.sky.android_mvvm_basic_framework.retrofit.QuotationRepository;
+import com.sky.financelake.bean.dto.QuotationDto;
+import com.sky.financelake.retrofit.ApiResponse;
+import com.sky.financelake.retrofit.QuotationRepository;
import java.util.List;
diff --git a/app/src/main/java/com/sky/android_mvvm_basic_framework/viewmodels/SplashViewModel.java b/app/src/main/java/com/sky/financelake/viewmodels/SplashViewModel.java
similarity index 49%
rename from app/src/main/java/com/sky/android_mvvm_basic_framework/viewmodels/SplashViewModel.java
rename to app/src/main/java/com/sky/financelake/viewmodels/SplashViewModel.java
index f16a99ed197ac057dbb84ca36718596656c8d5f5..41d28ac4cdc695ccdd9d4d9be7bfb7df1727a9a2 100644
--- a/app/src/main/java/com/sky/android_mvvm_basic_framework/viewmodels/SplashViewModel.java
+++ b/app/src/main/java/com/sky/financelake/viewmodels/SplashViewModel.java
@@ -1,4 +1,4 @@
-package com.sky.android_mvvm_basic_framework.viewmodels;
+package com.sky.financelake.viewmodels;
public class SplashViewModel extends BaseViewModel{
}
diff --git a/app/src/main/java/com/sky/android_mvvm_basic_framework/viewmodels/StockDetailViewModel.java b/app/src/main/java/com/sky/financelake/viewmodels/StockDetailViewModel.java
similarity index 78%
rename from app/src/main/java/com/sky/android_mvvm_basic_framework/viewmodels/StockDetailViewModel.java
rename to app/src/main/java/com/sky/financelake/viewmodels/StockDetailViewModel.java
index 213884638465bac26ee117b250280a1e8f10dcb5..a3921551fe28646bc7227c8c3d40e900c9b6fb13 100644
--- a/app/src/main/java/com/sky/android_mvvm_basic_framework/viewmodels/StockDetailViewModel.java
+++ b/app/src/main/java/com/sky/financelake/viewmodels/StockDetailViewModel.java
@@ -1,11 +1,11 @@
-package com.sky.android_mvvm_basic_framework.viewmodels;
+package com.sky.financelake.viewmodels;
import androidx.lifecycle.LiveData;
import androidx.lifecycle.MutableLiveData;
-import com.sky.android_mvvm_basic_framework.model.dto.StockDto;
-import com.sky.android_mvvm_basic_framework.retrofit.ApiResponse;
-import com.sky.android_mvvm_basic_framework.retrofit.StockRepository;
+import com.sky.financelake.bean.dto.StockDto;
+import com.sky.financelake.retrofit.ApiResponse;
+import com.sky.financelake.retrofit.StockRepository;
public class StockDetailViewModel extends BaseViewModel {
private MutableLiveData> mutableLiveData;
diff --git a/app/src/main/java/com/sky/android_mvvm_basic_framework/viewmodels/StockViewModel.java b/app/src/main/java/com/sky/financelake/viewmodels/StockViewModel.java
similarity index 73%
rename from app/src/main/java/com/sky/android_mvvm_basic_framework/viewmodels/StockViewModel.java
rename to app/src/main/java/com/sky/financelake/viewmodels/StockViewModel.java
index 97ee1f74f5b30665ffe7d2e2f3a7a1bb5b177722..b437491eb5eee7b0fe7d010cf43c554ef1a10ec4 100644
--- a/app/src/main/java/com/sky/android_mvvm_basic_framework/viewmodels/StockViewModel.java
+++ b/app/src/main/java/com/sky/financelake/viewmodels/StockViewModel.java
@@ -1,12 +1,12 @@
-package com.sky.android_mvvm_basic_framework.viewmodels;
+package com.sky.financelake.viewmodels;
import androidx.lifecycle.LiveData;
import androidx.lifecycle.MutableLiveData;
-import com.sky.android_mvvm_basic_framework.model.dto.StockDto;
-import com.sky.android_mvvm_basic_framework.model.param.StockParam;
-import com.sky.android_mvvm_basic_framework.retrofit.ApiResponse;
-import com.sky.android_mvvm_basic_framework.retrofit.StockRepository;
+import com.sky.financelake.bean.dto.StockDto;
+import com.sky.financelake.bean.param.StockParam;
+import com.sky.financelake.retrofit.ApiResponse;
+import com.sky.financelake.retrofit.StockRepository;
import java.util.List;
diff --git a/app/src/main/res/drawable/ic_choose_black_24dp.xml b/app/src/main/res/drawable/ic_choose_black_24dp.xml
new file mode 100644
index 0000000000000000000000000000000000000000..5df0f3f00f62a1693d1ba55185de4cd8cf57d2f4
--- /dev/null
+++ b/app/src/main/res/drawable/ic_choose_black_24dp.xml
@@ -0,0 +1,49 @@
+
+
+
diff --git a/app/src/main/res/drawable/ic_community_black_24dp.xml b/app/src/main/res/drawable/ic_community_black_24dp.xml
new file mode 100644
index 0000000000000000000000000000000000000000..e9d37f18ecc7952920b5435be48c119a256d72a5
--- /dev/null
+++ b/app/src/main/res/drawable/ic_community_black_24dp.xml
@@ -0,0 +1,6 @@
+
+
+
+
diff --git a/app/src/main/res/drawable/ic_home_black_24dp.xml b/app/src/main/res/drawable/ic_home_black_24dp.xml
new file mode 100644
index 0000000000000000000000000000000000000000..6ad9e513421488a32585514be90eafee3ce7c2e3
--- /dev/null
+++ b/app/src/main/res/drawable/ic_home_black_24dp.xml
@@ -0,0 +1,5 @@
+
+
+
diff --git a/app/src/main/res/drawable/ic_my_black_24dp.xml b/app/src/main/res/drawable/ic_my_black_24dp.xml
new file mode 100644
index 0000000000000000000000000000000000000000..97df4668715f4c80df3c4bd80bf622c935192383
--- /dev/null
+++ b/app/src/main/res/drawable/ic_my_black_24dp.xml
@@ -0,0 +1,5 @@
+
+
+
diff --git a/app/src/main/res/drawable/icon_loading.xml b/app/src/main/res/drawable/icon_loading.xml
new file mode 100644
index 0000000000000000000000000000000000000000..9a59c9e00d9b58f911f403504a7e3ab6cdd48aef
--- /dev/null
+++ b/app/src/main/res/drawable/icon_loading.xml
@@ -0,0 +1,42 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/drawable/shape_splash_time.xml b/app/src/main/res/drawable/shape_splash_time.xml
new file mode 100644
index 0000000000000000000000000000000000000000..e4d870c96967ece631dec1b4cb3749b995245942
--- /dev/null
+++ b/app/src/main/res/drawable/shape_splash_time.xml
@@ -0,0 +1,17 @@
+
+
+ -
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/drawable/shape_tag.xml b/app/src/main/res/drawable/shape_tag.xml
new file mode 100644
index 0000000000000000000000000000000000000000..ff9b1c7b87943e9f099009d390df99b31ef6d188
--- /dev/null
+++ b/app/src/main/res/drawable/shape_tag.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/activity_community_detail.xml b/app/src/main/res/layout/activity_community_detail.xml
new file mode 100644
index 0000000000000000000000000000000000000000..0920d51ea384a59839a420558a61000e14222239
--- /dev/null
+++ b/app/src/main/res/layout/activity_community_detail.xml
@@ -0,0 +1,24 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml
index 4fc244418b5fe524789352d1b1b52d1b22045f3a..95255b8192fe95db63798c50323e6cf550b350bd 100644
--- a/app/src/main/res/layout/activity_main.xml
+++ b/app/src/main/res/layout/activity_main.xml
@@ -4,15 +4,30 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
- tools:context=".MainActivity">
+ tools:context=".ui.activity.MainA">
-
+ app:menu="@menu/bottom_nav_menu" />
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/activity_pdf_view.xml b/app/src/main/res/layout/activity_pdf_view.xml
new file mode 100644
index 0000000000000000000000000000000000000000..a733446e56e7278d06ae1e7352bc9135c53a25c1
--- /dev/null
+++ b/app/src/main/res/layout/activity_pdf_view.xml
@@ -0,0 +1,14 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/activity_splash_screen.xml b/app/src/main/res/layout/activity_splash_screen.xml
index 28e6c300b47a5d348056c3dff48cb2db8d654ba0..b1bc4a14be2ab96efcd1b9b540d199a2becc6fcf 100644
--- a/app/src/main/res/layout/activity_splash_screen.xml
+++ b/app/src/main/res/layout/activity_splash_screen.xml
@@ -1,19 +1,35 @@
-
-
\ No newline at end of file
+ android:scaleType="fitXY"
+ app:layout_constraintTop_toBottomOf="parent"
+ app:layout_constraintStart_toStartOf="parent"
+ android:layout_height="match_parent" />
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/activity_test.xml b/app/src/main/res/layout/activity_test.xml
new file mode 100644
index 0000000000000000000000000000000000000000..de985b5258532e3a7dc7745ded46434a2511cb56
--- /dev/null
+++ b/app/src/main/res/layout/activity_test.xml
@@ -0,0 +1,24 @@
+
+
+
+
+
+
+
+
+
diff --git a/app/src/main/res/layout/fragment_choose.xml b/app/src/main/res/layout/fragment_choose.xml
new file mode 100644
index 0000000000000000000000000000000000000000..5c1a6be0308e03b86c1cac7fc7aace2c6bfa7e26
--- /dev/null
+++ b/app/src/main/res/layout/fragment_choose.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/fragment_community.xml b/app/src/main/res/layout/fragment_community.xml
new file mode 100644
index 0000000000000000000000000000000000000000..5319e2e494fff8ad930ee8d869be5a0ba9b95d36
--- /dev/null
+++ b/app/src/main/res/layout/fragment_community.xml
@@ -0,0 +1,30 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/fragment_community_bar.xml b/app/src/main/res/layout/fragment_community_bar.xml
new file mode 100644
index 0000000000000000000000000000000000000000..a50d484b564325ea1b178aa99e900bac5cdafc6c
--- /dev/null
+++ b/app/src/main/res/layout/fragment_community_bar.xml
@@ -0,0 +1,11 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/fragment_community_skill.xml b/app/src/main/res/layout/fragment_community_skill.xml
new file mode 100644
index 0000000000000000000000000000000000000000..5e9d34582eaa32b1e0aaf96b39f39743071834c0
--- /dev/null
+++ b/app/src/main/res/layout/fragment_community_skill.xml
@@ -0,0 +1,24 @@
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/fragment_community_talk.xml b/app/src/main/res/layout/fragment_community_talk.xml
new file mode 100644
index 0000000000000000000000000000000000000000..075869bf13ecf0c285fead903739c12bf06cc8d5
--- /dev/null
+++ b/app/src/main/res/layout/fragment_community_talk.xml
@@ -0,0 +1,11 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/fragment_home.xml b/app/src/main/res/layout/fragment_home.xml
new file mode 100644
index 0000000000000000000000000000000000000000..02ea8bc080b14758e7dd333b13aa713a845b1192
--- /dev/null
+++ b/app/src/main/res/layout/fragment_home.xml
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/fragment_my.xml b/app/src/main/res/layout/fragment_my.xml
new file mode 100644
index 0000000000000000000000000000000000000000..3e3bfd568bb49c4bf691f23aa6a426d83b2d4b24
--- /dev/null
+++ b/app/src/main/res/layout/fragment_my.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/item_common_footer.xml b/app/src/main/res/layout/item_common_footer.xml
new file mode 100644
index 0000000000000000000000000000000000000000..87667787722f93fe2e3cc490970a6a7ccc037fdd
--- /dev/null
+++ b/app/src/main/res/layout/item_common_footer.xml
@@ -0,0 +1,35 @@
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/item_community_skill.xml b/app/src/main/res/layout/item_community_skill.xml
new file mode 100644
index 0000000000000000000000000000000000000000..50d0d8b79079b6fc30755208d196cc30d1d6296b
--- /dev/null
+++ b/app/src/main/res/layout/item_community_skill.xml
@@ -0,0 +1,67 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/loading_layout.xml b/app/src/main/res/layout/loading_layout.xml
new file mode 100644
index 0000000000000000000000000000000000000000..a587979fd52ef48a8b07c99d0d35623deeecd074
--- /dev/null
+++ b/app/src/main/res/layout/loading_layout.xml
@@ -0,0 +1,47 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/src/main/res/layout/toolbar.xml b/app/src/main/res/layout/toolbar.xml
new file mode 100644
index 0000000000000000000000000000000000000000..c86ab7909f007c8d524151626a14b8f0d461feeb
--- /dev/null
+++ b/app/src/main/res/layout/toolbar.xml
@@ -0,0 +1,12 @@
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/view_normal_refresh_footer.xml b/app/src/main/res/layout/view_normal_refresh_footer.xml
new file mode 100644
index 0000000000000000000000000000000000000000..61a4490a439b9d9a009a0584dfe8d46706458c00
--- /dev/null
+++ b/app/src/main/res/layout/view_normal_refresh_footer.xml
@@ -0,0 +1,6 @@
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/menu/bottom_nav_menu.xml b/app/src/main/res/menu/bottom_nav_menu.xml
new file mode 100644
index 0000000000000000000000000000000000000000..d32ccb188c4a07d13add35baf42ecfb04e25a296
--- /dev/null
+++ b/app/src/main/res/menu/bottom_nav_menu.xml
@@ -0,0 +1,26 @@
+
+
\ No newline at end of file
diff --git a/app/src/main/res/mipmap-mdpi/ic_reload.png b/app/src/main/res/mipmap-mdpi/ic_reload.png
new file mode 100644
index 0000000000000000000000000000000000000000..73f1db69dd98593883f2a6efbe3525c8f7ccf2d2
Binary files /dev/null and b/app/src/main/res/mipmap-mdpi/ic_reload.png differ
diff --git a/app/src/main/res/mipmap-mdpi/ic_warning.png b/app/src/main/res/mipmap-mdpi/ic_warning.png
new file mode 100644
index 0000000000000000000000000000000000000000..561e28ae408ca919f27b639d12cf2c383563c263
Binary files /dev/null and b/app/src/main/res/mipmap-mdpi/ic_warning.png differ
diff --git a/app/src/main/res/mipmap-xhdpi/bga_refresh_loading01.png b/app/src/main/res/mipmap-xhdpi/bga_refresh_loading01.png
new file mode 100644
index 0000000000000000000000000000000000000000..1c190a9923f318d38cab910c3d559d1656fd7718
Binary files /dev/null and b/app/src/main/res/mipmap-xhdpi/bga_refresh_loading01.png differ
diff --git a/app/src/main/res/mipmap-xhdpi/bga_refresh_loading02.png b/app/src/main/res/mipmap-xhdpi/bga_refresh_loading02.png
new file mode 100644
index 0000000000000000000000000000000000000000..bc930f2d4bdd1e8dd7aa2ee2515967574c4ef692
Binary files /dev/null and b/app/src/main/res/mipmap-xhdpi/bga_refresh_loading02.png differ
diff --git a/app/src/main/res/mipmap-xhdpi/bga_refresh_loading03.png b/app/src/main/res/mipmap-xhdpi/bga_refresh_loading03.png
new file mode 100644
index 0000000000000000000000000000000000000000..e461335e941e47b8e72fc4d3ac333dce759e13c4
Binary files /dev/null and b/app/src/main/res/mipmap-xhdpi/bga_refresh_loading03.png differ
diff --git a/app/src/main/res/mipmap-xhdpi/bga_refresh_loading04.png b/app/src/main/res/mipmap-xhdpi/bga_refresh_loading04.png
new file mode 100644
index 0000000000000000000000000000000000000000..071af1edd4abb38037f943ab8fe82e82af77604f
Binary files /dev/null and b/app/src/main/res/mipmap-xhdpi/bga_refresh_loading04.png differ
diff --git a/app/src/main/res/mipmap-xhdpi/bga_refresh_loading05.png b/app/src/main/res/mipmap-xhdpi/bga_refresh_loading05.png
new file mode 100644
index 0000000000000000000000000000000000000000..43ba85ffdb3ceb2fd9012dfcd50a7f1c83955221
Binary files /dev/null and b/app/src/main/res/mipmap-xhdpi/bga_refresh_loading05.png differ
diff --git a/app/src/main/res/mipmap-xhdpi/bga_refresh_loading06.png b/app/src/main/res/mipmap-xhdpi/bga_refresh_loading06.png
new file mode 100644
index 0000000000000000000000000000000000000000..67c6faa11c0dcd197315aa66b4e17324cb025cd6
Binary files /dev/null and b/app/src/main/res/mipmap-xhdpi/bga_refresh_loading06.png differ
diff --git a/app/src/main/res/mipmap-xhdpi/bga_refresh_loading07.png b/app/src/main/res/mipmap-xhdpi/bga_refresh_loading07.png
new file mode 100644
index 0000000000000000000000000000000000000000..797c5d8a1f4ee2518ca68d2e18b3e23d665088e4
Binary files /dev/null and b/app/src/main/res/mipmap-xhdpi/bga_refresh_loading07.png differ
diff --git a/app/src/main/res/mipmap-xhdpi/bga_refresh_loading08.png b/app/src/main/res/mipmap-xhdpi/bga_refresh_loading08.png
new file mode 100644
index 0000000000000000000000000000000000000000..bbeecf25f50bf4f55438c932602d12bae8f62a94
Binary files /dev/null and b/app/src/main/res/mipmap-xhdpi/bga_refresh_loading08.png differ
diff --git a/app/src/main/res/mipmap-xhdpi/bga_refresh_loading09.png b/app/src/main/res/mipmap-xhdpi/bga_refresh_loading09.png
new file mode 100644
index 0000000000000000000000000000000000000000..397c08dabe0c7eddad215ff4598d7675e1e4db04
Binary files /dev/null and b/app/src/main/res/mipmap-xhdpi/bga_refresh_loading09.png differ
diff --git a/app/src/main/res/mipmap-xhdpi/bga_refresh_loading10.png b/app/src/main/res/mipmap-xhdpi/bga_refresh_loading10.png
new file mode 100644
index 0000000000000000000000000000000000000000..2c4c58b20ed62ed38954c17c70a06f2cb5ea5a9a
Binary files /dev/null and b/app/src/main/res/mipmap-xhdpi/bga_refresh_loading10.png differ
diff --git a/app/src/main/res/mipmap-xhdpi/bga_refresh_loading11.png b/app/src/main/res/mipmap-xhdpi/bga_refresh_loading11.png
new file mode 100644
index 0000000000000000000000000000000000000000..587c1df6ca26891df1299e474b48fa326f67022e
Binary files /dev/null and b/app/src/main/res/mipmap-xhdpi/bga_refresh_loading11.png differ
diff --git a/app/src/main/res/mipmap-xhdpi/bga_refresh_loading12.png b/app/src/main/res/mipmap-xhdpi/bga_refresh_loading12.png
new file mode 100644
index 0000000000000000000000000000000000000000..162ffd4667ab811d3eca218134ae91d86edd495c
Binary files /dev/null and b/app/src/main/res/mipmap-xhdpi/bga_refresh_loading12.png differ
diff --git a/app/src/main/res/navigation/mobile_navigation.xml b/app/src/main/res/navigation/mobile_navigation.xml
new file mode 100644
index 0000000000000000000000000000000000000000..9c558d1a9aaebdf1670cea3d8edafa3875079ed9
--- /dev/null
+++ b/app/src/main/res/navigation/mobile_navigation.xml
@@ -0,0 +1,31 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/values-w820dp/dimens.xml b/app/src/main/res/values-w820dp/dimens.xml
new file mode 100644
index 0000000000000000000000000000000000000000..9309de98203ebfb9258db61e51c31d0e9d6bd379
--- /dev/null
+++ b/app/src/main/res/values-w820dp/dimens.xml
@@ -0,0 +1,6 @@
+
+
+ 64dp
+
\ No newline at end of file
diff --git a/app/src/main/res/values/arrays.xml b/app/src/main/res/values/arrays.xml
new file mode 100644
index 0000000000000000000000000000000000000000..ef21d6b371ec09468ef0d57902f4c4812dc985c5
--- /dev/null
+++ b/app/src/main/res/values/arrays.xml
@@ -0,0 +1,8 @@
+
+
+
+ - 技巧
+ - 帖吧
+ - 说说
+
+
\ No newline at end of file
diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml
index e5482741087c48573036cecbe3fdb4e4152b8451..5a75dc280b2d1bbb8ea1fcdc85655a809d6e1b00 100644
--- a/app/src/main/res/values/colors.xml
+++ b/app/src/main/res/values/colors.xml
@@ -8,5 +8,8 @@
#FF000000
#FFFFFFFF
+ #ffff4757
+ #aaff4757
+
#FFD9E1E2
\ No newline at end of file
diff --git a/app/src/main/res/values/dimens.xml b/app/src/main/res/values/dimens.xml
index bf606ac1c750f274d9ddb73a7660db6b5dbe13fa..cb943a38fa7bdc156a45cd34a148810ac370ff50 100644
--- a/app/src/main/res/values/dimens.xml
+++ b/app/src/main/res/values/dimens.xml
@@ -2,4 +2,10 @@
16dp
16dp
16dp
+ 16dp
+
+ 16dp
+ 16dp
+ 16dp
+ 8dp
\ No newline at end of file
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index 4a2201bf0c84a66ee7061fdab70e15d0f6bf5ba9..6444d8a2dc5d181d25c504e7ae142f5dd38511b0 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -1,3 +1,11 @@
- android-mvvm-basic-framework
+ 金融江湖
+ 首页
+ 选股
+ 我的
+ 社区
+ 详情
+ 加载中...
+ 我是有底线的
+ 请求错误
\ No newline at end of file
diff --git a/app/src/main/res/values/themes.xml b/app/src/main/res/values/themes.xml
index 17a942ad835b4dba92b17b89e53cb7835a28dbb7..2594389c22e9a7a1bec4f9deada8981e30f07c1e 100644
--- a/app/src/main/res/values/themes.xml
+++ b/app/src/main/res/values/themes.xml
@@ -1,9 +1,9 @@
-
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/xml/provider_paths.xml b/app/src/main/res/xml/provider_paths.xml
new file mode 100644
index 0000000000000000000000000000000000000000..833e561140bfcf5b1d3555df1998da825d1e5fb1
--- /dev/null
+++ b/app/src/main/res/xml/provider_paths.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/test/java/com/sky/android_mvvm_basic_framework/ExampleUnitTest.java b/app/src/test/java/com/sky/financelake/ExampleUnitTest.java
similarity index 88%
rename from app/src/test/java/com/sky/android_mvvm_basic_framework/ExampleUnitTest.java
rename to app/src/test/java/com/sky/financelake/ExampleUnitTest.java
index 4261aceecd0e48aa8a903a0cd5509cbea786d2dc..da680a7b68cd49417c8c7fd41ff39f2fd5cabd7b 100644
--- a/app/src/test/java/com/sky/android_mvvm_basic_framework/ExampleUnitTest.java
+++ b/app/src/test/java/com/sky/financelake/ExampleUnitTest.java
@@ -1,4 +1,4 @@
-package com.sky.android_mvvm_basic_framework;
+package com.sky.financelake;
import org.junit.Test;
diff --git a/build.gradle b/build.gradle
index cdea38cde17fefbc81c94ee9f71f744b479ca624..617c3fe918000482569c062174d28c41092e6785 100644
--- a/build.gradle
+++ b/build.gradle
@@ -5,7 +5,7 @@ buildscript {
repositories {
google()
// jcenter()
- maven{url 'http://maven.aliyun.com/nexus/content/groups/public/'}
+ maven { url 'http://maven.aliyun.com/nexus/content/groups/public/' }
}
dependencies {
classpath "com.android.tools.build:gradle:4.1.3"
@@ -19,7 +19,8 @@ allprojects {
repositories {
google()
// jcenter()
- maven{url 'http://maven.aliyun.com/nexus/content/groups/public/'}
+ maven { url 'http://maven.aliyun.com/nexus/content/groups/public/' }
+ maven { url 'https://jitpack.io' }
}
}
diff --git a/settings.gradle b/settings.gradle
index 3b6c70260bbc3a238fd00d100691cfa2bcb4d171..d6235d4a24aa9fabff800e8252cd1f9a8d9e7f20 100644
--- a/settings.gradle
+++ b/settings.gradle
@@ -1,2 +1,2 @@
include ':app'
-rootProject.name = "android-mvvm-basic-framework"
\ No newline at end of file
+rootProject.name = "FinanceLake"
\ No newline at end of file