Skip to content

Commit

Permalink
修改内容
Browse files Browse the repository at this point in the history
  • Loading branch information
monkeycf authored and monkeycf committed Jan 2, 2020
1 parent 717e9eb commit a8daeff
Show file tree
Hide file tree
Showing 11 changed files with 30 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
Expand Down Expand Up @@ -40,9 +41,7 @@
public class PersonalFragment extends Fragment {

private String TAG = PersonalFragment.class.getSimpleName();
private int[] sampleImages = {R.drawable.ic_add_note, R.drawable.ic_back, R.drawable.ic_cancel,
R.drawable.ic_camera,
R.drawable.ic_chb_selectd};
private int[] sampleImages = {R.drawable.bg_banner_1, R.drawable.bg_banner_2, R.drawable.bg_banner_3};
private UserLoginResModule mUserLoginResModule;

@BindView(R.id.iv_personal_head)
Expand All @@ -57,6 +56,8 @@ public class PersonalFragment extends Fragment {
ConstraintLayout mConstraintLayoutNote;
@BindView(R.id.constraint_layout_blog)
ConstraintLayout mConstraintLayoutBlog;
@BindView(R.id.constraint_layout_history)
ConstraintLayout mConstraintLayoutHistory;

@Nullable
@Override
Expand All @@ -81,12 +82,17 @@ public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup c
});
mConstraintLayoutNote.setOnClickListener(view -> {
// 我的笔记
Toast.makeText(getContext(), "敬请期待", Toast.LENGTH_SHORT).show();
});
mConstraintLayoutBlog.setOnClickListener(view -> {
// 我的博客
Intent intent = WebViewActivity.newIntent(getActivity(), "https://blog.chensenran.top/", "我的博客");
startActivity(intent);
});
mConstraintLayoutHistory.setOnClickListener(view->{
// 我的记录
Toast.makeText(getContext(), "暂未开放", Toast.LENGTH_SHORT).show();
});
return v;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ protected void onCreate(@Nullable Bundle savedInstanceState) {
init();
}

/**
* 初始化
*/
protected void init() {
mSelectedPictures = (ArrayList<Picture>) getIntent().getExtras().get(SELECT_PICTURE_PRE_KEY);
if (mSelectedPictures != null) {
Expand Down Expand Up @@ -67,6 +70,9 @@ public static Intent newIntent(Context context, ArrayList<Picture> pictures) {
return intent;
}

/**
* Adapter
*/
private class PreViewImageViewAdapter extends FragmentPagerAdapter {
private PreViewImageViewAdapter(@NonNull FragmentManager fm, int behavior) {
super(fm, behavior);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@ public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup c
return v;
}

/**
* 实例化
*
* @param picture 需要预览的图片
* @return ViewPreImageFragment实例
*/
public static ViewPreImageFragment getInstance(Picture picture) {
Bundle bundle = new Bundle();
bundle.putSerializable(VIEW_PRE_IMAGE_FRAGMENT_KEY, picture);
Expand All @@ -43,6 +49,9 @@ public static ViewPreImageFragment getInstance(Picture picture) {
return viewPreImageFragment;
}

/**
* 单例
*/
private ViewPreImageFragment() {
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ protected void onCreate(Bundle savedInstanceState) {
recyclerViewCollect.setAdapter(mCollectAdapter);
}

/**
* 获取收藏列表数据
*/
private void getTopics() {
TopicApi.getInstance().getTopicCollected(getUserInfoByDataBase(),
new IHttpCallBack<BaseResult<List<TopicInfoModule>>>() {
Expand Down
Binary file added app/src/main/res/drawable-v24/bg_banner_1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/drawable-v24/bg_banner_2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/drawable-v24/bg_banner_3.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/drawable/bg_banner_1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/drawable/bg_banner_2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/drawable/bg_banner_3.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions app/src/main/res/layout/index_personal_fragment.xml
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@
android:id="@+id/imageView3"
android:layout_width="30dp"
android:layout_height="30dp"
android:src="@drawable/ic_personal_history"
android:src="@drawable/ic_personal_note"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
Expand All @@ -263,7 +263,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/constraintLayout8"
app:layout_constraintEnd_toStartOf="@+id/constraint_layout_history"
app:layout_constraintStart_toEndOf="@+id/constraint_layout_note"
app:layout_constraintTop_toTopOf="parent">

Expand All @@ -287,7 +287,7 @@
</androidx.constraintlayout.widget.ConstraintLayout>

<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/constraintLayout8"
android:id="@+id/constraint_layout_history"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintEnd_toEndOf="parent"
Expand Down

0 comments on commit a8daeff

Please sign in to comment.