Skip to content

Commit

Permalink
新的”我的"界面
Browse files Browse the repository at this point in the history
  • Loading branch information
Z-P-J committed Jan 27, 2020
1 parent b00debc commit a971e67
Show file tree
Hide file tree
Showing 27 changed files with 1,495 additions and 181 deletions.
Binary file modified .idea/caches/build_file_checksums.ser
Binary file not shown.
Binary file modified .idea/caches/gradle_models.ser
Binary file not shown.
2 changes: 2 additions & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ dependencies {
implementation project(':zpopup')
implementation project(':glidegifdecoder')
implementation project(':openingstartanimation')
implementation project(':pullzoom')



implementation 'com.github.bumptech.glide:glide:4.7.1'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import com.zpj.shouji.market.ui.fragment.base.BaseFragment;
import com.zpj.shouji.market.ui.fragment.game.GameFragment;
import com.zpj.shouji.market.ui.fragment.homepage.HomeFragment;
import com.zpj.shouji.market.ui.fragment.profile.ProfileFragment;
import com.zpj.shouji.market.ui.fragment.profile.MeFragment;
import com.zpj.shouji.market.ui.fragment.soft.SoftFragment;
import com.zpj.shouji.market.ui.view.AddLayout;
import com.zpj.shouji.market.ui.view.ZViewPager;
Expand Down Expand Up @@ -56,9 +56,9 @@ protected void initView(View view, @Nullable Bundle savedInstanceState) {
game = new GameFragment();
}

ProfileFragment profileFragment = findChildFragment(ProfileFragment.class);
MeFragment profileFragment = findChildFragment(MeFragment.class);
if (profileFragment == null) {
profileFragment = ProfileFragment.newInstance("5636865", true);
profileFragment = new MeFragment();
}
fragments.clear();
fragments.add(homeFragment);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public final View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewG
if (getLayoutId() > 0) {
view = inflater.inflate(getLayoutId(), container, false);
titleBar = view.findViewById(R.id.title_bar);
if (titleBar != null && titleBar.getLeftImageButton() != null) {
if (titleBar != null) {
if (titleBar.getLeftImageButton() != null) {
toolbarLeftImageButton(titleBar.getLeftImageButton());
} else if (titleBar.getLeftCustomView() != null) {
Expand All @@ -55,6 +55,15 @@ public final View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewG
} else if (titleBar.getRightTextView() != null) {
toolbarRightTextView(titleBar.getRightTextView());
}

if (titleBar.getCenterTextView() != null) {
toolbarCenterTextView(titleBar.getCenterTextView());
} else if (titleBar.getCenterSubTextView() != null) {
toolbarCenterSubTextView(titleBar.getCenterSubTextView());
} else if (titleBar.getCenterCustomView() != null) {
toolbarCenterCustomView(titleBar.getCenterCustomView());
}

if (titleBar.getCenterTextView() != null) {
titleBar.getCenterTextView().setText(getToolbarTitle());
}
Expand Down Expand Up @@ -113,6 +122,18 @@ public void toolbarRightTextView(@NonNull TextView view) {

}

public void toolbarCenterTextView(@NonNull TextView view) {

}

public void toolbarCenterSubTextView(@NonNull TextView view) {

}

public void toolbarCenterCustomView(@NonNull View view) {

}

public void setToolbarTitle(String title) {
if (titleBar != null && titleBar.getCenterTextView() != null) {
titleBar.getCenterTextView().setText(title);
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
package com.zpj.shouji.market.ui.fragment.profile;

import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.view.View;
import android.widget.ImageButton;
import android.widget.TextView;

import com.felix.atoast.library.AToast;
import com.lzy.widget.PullZoomView;
import com.zpj.popupmenuview.popup.EverywherePopup;
import com.zpj.shouji.market.R;
import com.zpj.shouji.market.ui.fragment.base.BaseFragment;
import com.zpj.shouji.market.ui.widget.CircleImageView;
import com.zpj.shouji.market.utils.UserManager;
import com.zpj.utils.ClickHelper;

public class MeFragment extends BaseFragment {

private TextView tvName, tvSignature;
private CircleImageView ivAvatar;

@Override
protected int getLayoutId() {
return R.layout.fragment_me;
}

@Override
protected void initView(View view, @Nullable Bundle savedInstanceState) {
PullZoomView pullZoomView = view.findViewById(R.id.view_pull_zoom);
pullZoomView.setIsZoomEnable(true);
pullZoomView.setIsParallax(false);
pullZoomView.setSensitive(3f);
pullZoomView.setZoomTime(500);

tvName = view.findViewById(R.id.tv_name);
tvSignature = view.findViewById(R.id.tv_signature);
ivAvatar = view.findViewById(R.id.iv_avatar);

ClickHelper.with(ivAvatar)
.setOnLongClickListener((v, x, y) -> {
EverywherePopup.create(context)
.addItem("更换我的头像")
.addItem("下载头像")
.setOnItemClickListener((title, position) -> {
switch (position) {
case 0:
break;
case 1:
break;
}
AToast.normal(title);
})
.apply()
.showEverywhere(v, x, y);
return true;
});

ClickHelper.with(view.findViewById(R.id.iv_wallpaper))
.setOnLongClickListener((v, x, y) -> {
EverywherePopup.create(context)
.addItem("更换主页背景")
.addItem("下载背景")
.setOnItemClickListener((title, position) -> {
switch (position) {
case 0:
break;
case 1:
break;
}
AToast.normal(title);
})
.apply()
.showEverywhere(v, x, y);
return true;
// if (UserManager.isLogin()) {
//
// return true;
// }
// return false;
});

// if (UserManager.isLogin()) {
//
// } else {
//
// }
}

@Override
public void onLazyInitView(@Nullable Bundle savedInstanceState) {
super.onLazyInitView(savedInstanceState);
}

@Override
public void toolbarRightImageButton(@NonNull ImageButton imageButton) {
imageButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
EverywherePopup.create(context)
.addItem("分享主页")
.addItem("复制主页链接")
.setOnItemClickListener(new EverywherePopup.OnItemClickListener() {
@Override
public void onItemClicked(String title, int position) {
AToast.normal(title);
}
})
.apply()
.show(v);
}
});
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,8 @@ public static String getCookie() {
}
return cookie;
}

public static boolean isLogin() {
return SPHelper.getBoolean("is_login", false);
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 17 additions & 0 deletions app/src/main/res/drawable/bg_button_round_gray.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle"
>

<solid android:color="#80cccccc"/>
<corners android:radius="4dp"/>

<padding
android:left="16dp"
android:right="16dp"
android:bottom="8dp"
android:top="8dp"
/>

</shape>
Loading

0 comments on commit a971e67

Please sign in to comment.