Skip to content

Commit

Permalink
修复了Android 6.0.1设备上头像动画完毕后会遮挡其他控件的问题。
Browse files Browse the repository at this point in the history
forrestsocool committed Sep 16, 2019
1 parent efd719a commit 7892d3c
Showing 12 changed files with 72 additions and 100 deletions.
Binary file modified .idea/caches/build_file_checksums.ser
Binary file not shown.
29 changes: 0 additions & 29 deletions .idea/codeStyles/Project.xml

This file was deleted.

4 changes: 4 additions & 0 deletions .idea/encodings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 13 additions & 3 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -6,8 +6,8 @@ android {
applicationId "io.github.sm1314.profile3d.app"
minSdkVersion 19
targetSdkVersion 19
versionCode 1
versionName "1.0"
versionCode 2
versionName '1.1'
//multiDexEnabled true
}
buildTypes {
2 changes: 1 addition & 1 deletion feature/build.gradle
Original file line number Diff line number Diff line change
@@ -38,7 +38,7 @@ dependencies {
implementation project(path: ':tagcloudlib')
implementation 'com.facebook.fresco:fresco:1.11.0'
implementation 'com.google.code.gson:gson:2.8.5'
implementation 'com.squareup.okhttp3:okhttp:3.11.0'
implementation 'com.squareup.okhttp3:okhttp:3.12.0'
implementation 'com.github.IntruderShanky:Frisson:2.1.1'
implementation 'com.android.support:cardview-v7:27.1.1'
compile 'com.android.support:design:27.1.1'
Original file line number Diff line number Diff line change
@@ -181,10 +181,11 @@ protected void initData() {
Call call = okHttpClient.newCall(request); //3.使用client去请求
call.enqueue(new Callback() { //4.回调方法
@Override
public void onFailure(Call call, IOException e) {
public void onFailure(Call call, final IOException e) {
runOnUiThread(new Runnable() {
@Override
public void run() {
Toast.makeText(getApplicationContext(),e.getMessage(),Toast.LENGTH_LONG).show();
findViewById(R.id.tv_noresult).setVisibility(View.VISIBLE);
findViewById(R.id.spin_kit).setVisibility(View.INVISIBLE);
}
Original file line number Diff line number Diff line change
@@ -18,12 +18,12 @@ public class MyApplication extends Application {
public List<String> deptList;
public List<String> posiList;
public List<String> yearList;
// public static String BASE_URL = "http://23.25.4.84:8080/api";
// public static String EMPLOYEE_GET_URL = "http://23.25.4.84:8080/api/empl";
public static String BASE_URL = "http://23.25.4.84:8080/api";
public static String EMPLOYEE_GET_URL = "http://23.25.4.84:8080/api/empl";
// public static String BASE_URL = "http://192.168.1.8:8080/api";
// public static String EMPLOYEE_GET_URL = "http://192.168.1.8:8080/api/empl";
public static String BASE_URL = "http://172.96.241.34:8080/api";
public static String EMPLOYEE_GET_URL = "http://172.96.241.34:8080/api/empl";
//public static String BASE_URL = "http://172.96.241.34:8080/api";
//public static String EMPLOYEE_GET_URL = "http://172.96.241.34:8080/api/empl";
@Override
public void onCreate() {
super.onCreate();
Original file line number Diff line number Diff line change
@@ -1,46 +1,26 @@
package io.github.sm1314.profile3d.feature.activity;

import android.content.Context;
import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Color;
import android.net.Uri;
import android.os.Handler;
import android.os.Looper;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.support.v7.widget.Toolbar;
import android.view.View;
import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.bumptech.glide.Glide;
import com.bumptech.glide.load.resource.bitmap.CenterCrop;
import com.bumptech.glide.load.resource.bitmap.RoundedCorners;
import com.bumptech.glide.request.RequestOptions;
import com.google.gson.Gson;
import com.intrusoft.library.FrissonView;

import java.io.IOException;
import java.io.InputStream;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Date;

import io.github.sm1314.profile3d.feature.GlideApp;
import io.github.sm1314.profile3d.feature.MyApplication;
import io.github.sm1314.profile3d.feature.R;
import io.github.sm1314.profile3d.feature.adapter.TextTagsAdapter;
import io.github.sm1314.profile3d.feature.adapter.VectorTagsAdapter;
import io.github.sm1314.profile3d.feature.adapter.ViewTagsAdapter;
import io.github.sm1314.profile3d.feature.model.Employee;
import io.github.sm1314.tagcloudlib.view.TagCloudView;
import okhttp3.Call;
import okhttp3.Callback;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.Response;

import static com.bumptech.glide.load.resource.drawable.DrawableTransitionOptions.withCrossFade;

@@ -52,6 +32,8 @@ public class ProfileActivity extends BaseActivity {
private FrissonView frissonView;
private Bitmap avatarBitmap;
private Handler mHandler;
private ImageButton imageButtonClose;
private LinearLayout llEmplInfo;

@Override
protected void onCreate(Bundle savedInstanceState) {
@@ -60,8 +42,9 @@ protected void onCreate(Bundle savedInstanceState) {
//设置彩色statusbar
setStatusBar(R.color.colorPrimary);
//设置返回按钮
findViewById(R.id.view_back).setClickable(true);
findViewById(R.id.view_back).setOnClickListener(new View.OnClickListener() {
imageButtonClose = findViewById(R.id.view_back);
imageButtonClose.setClickable(true);
imageButtonClose.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
ProfileActivity.this.finish();
@@ -70,7 +53,8 @@ public void onClick(View view) {
//获取传参
Intent intent = this.getIntent();
employee = (Employee) intent.getParcelableExtra("employee");

frissonView = findViewById(R.id.wave_head);
llEmplInfo = findViewById(R.id.ll_info);
}

@Override
@@ -89,15 +73,18 @@ protected void onRestoreInstanceState(Bundle savedInstanceState) {
protected void onStart() {
super.onStart();

setUpAvatar();

Handler mHandler = new Handler(this.getMainLooper());
mHandler.postDelayed(new Runnable() {
@Override
public void run() {
setUpContent();
imageButtonClose.bringToFront();
llEmplInfo.bringToFront();
}
}, 500);

setUpAvatar();
}, 1500);
//frissonView.bringToFront();
}

@Override
@@ -155,7 +142,7 @@ public void setUpAvatar()
// .placeholder(R.drawable.placeholder)
// into(imageView);
//setCrossFadeEnabled
GlideApp.with(this).load(uri).circleCrop().placeholder(employee.getSex().equals("女")? R.drawable.women : R.drawable.man).circleCrop().transition(withCrossFade(1000)).into(imageView);
GlideApp.with(this).load(uri).circleCrop().placeholder(employee.getSex().contains("女")? R.drawable.women : R.drawable.man).circleCrop().transition(withCrossFade(1000)).into(imageView);
//Glide.with(this)
}

Original file line number Diff line number Diff line change
@@ -78,7 +78,7 @@ protected void convert(BaseViewHolder holder, final Employee item) {
// ((EmployeeHolder) holder).empl_avatar.setHierarchy(hierarchy);


GlideApp.with(context).load(uri).circleCrop().placeholder(item.getSex().equals("女")? R.drawable.women : R.drawable.man).circleCrop().into(((EmployeeHolder) holder).image_avatar);
GlideApp.with(context).load(uri).circleCrop().placeholder(item.getSex().contains("女")? R.drawable.women : R.drawable.man).circleCrop().into(((EmployeeHolder) holder).image_avatar);

//设置点击效果
((EmployeeHolder) holder).itemView.setOnClickListener(new View.OnClickListener() {
Original file line number Diff line number Diff line change
@@ -129,7 +129,7 @@ public View getView(final Context context, final int position, ViewGroup parent)


ImageView ivAvatar = (ImageView) view.findViewById(R.id.iv_avatar_small);
GlideApp.with(context).load(uri).circleCrop().placeholder(employee.getSex().equals("女")? R.drawable.women : R.drawable.man).circleCrop().into(ivAvatar);
GlideApp.with(context).load(uri).circleCrop().placeholder(employee.getSex().contains("女")? R.drawable.women : R.drawable.man).circleCrop().into(ivAvatar);


//设置点击回调
57 changes: 28 additions & 29 deletions feature/src/main/res/layout/activity_profile.xml
Original file line number Diff line number Diff line change
@@ -31,55 +31,54 @@
android:background="?android:attr/selectableItemBackground"
android:src="@drawable/ic_navigate_before_black_36dp" />

<RelativeLayout
<RelativeLayout
android:id="@+id/my_image_view"
android:layout_marginStart="24dp"
android:layout_marginTop="100dp"
android:layout_width="120dp"
android:layout_height="120dp"
android:padding="1dp"
android:background="@drawable/round_border_style">
<ImageView
<ImageView
android:id="@+id/iv_avatar"
android:layout_width="120dp"
android:layout_height="120dp"
/>
</RelativeLayout>
android:layout_height="120dp" />
</RelativeLayout>

<LinearLayout
android:id="@+id/ll_info"
android:orientation="vertical"
android:layout_marginTop="100dp"
android:layout_marginStart="36dp"
android:layout_toEndOf="@+id/my_image_view"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:id="@+id/tv_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignTop="@+id/my_image_view"
android:layout_marginLeft="36dp"
android:layout_toRightOf="@+id/my_image_view"
android:fontFamily="sans-serif-smallcaps"
android:text="--姓名--"
android:textColor="#ccffffff"
android:textSize="22sp"
android:textStyle="bold" />
<TextView
android:id="@+id/tv_department"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:text="--部门--"
android:textColor="#aaffffff" />

<TextView
android:id="@+id/tv_department"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/tv_name"
android:layout_marginLeft="36dp"
android:layout_marginTop="8dp"
android:layout_toRightOf="@+id/my_image_view"
android:text="--部门--"
android:textColor="#aaffffff" />

<TextView
android:id="@+id/tv_position"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/tv_department"
android:layout_marginLeft="36dp"
android:layout_marginTop="8dp"
android:layout_toRightOf="@+id/my_image_view"
android:text="--职务--"
android:textColor="#aaffffff" />
<TextView
android:id="@+id/tv_position"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:text="--职务--"
android:textColor="#aaffffff" />

</LinearLayout>

<LinearLayout
android:layout_width="match_parent"

0 comments on commit 7892d3c

Please sign in to comment.