Commit f9a8452e by jeffrey

修改完界面

parent 61a70773
...@@ -20,7 +20,7 @@ android { ...@@ -20,7 +20,7 @@ android {
buildToolsVersion "26.0.2" buildToolsVersion "26.0.2"
defaultConfig { defaultConfig {
applicationId "com.xf.weixinclick" applicationId "com.xf.weixinclick"
minSdkVersion 16 minSdkVersion 21
targetSdkVersion 25 targetSdkVersion 25
versionCode 4 versionCode 4
versionName "1.3" versionName "1.3"
......
package com.xf.weixinclick; package com.xf.weixinclick;
import android.app.ProgressDialog; import android.app.ProgressDialog;
import android.graphics.Color;
import android.os.Bundle; import android.os.Bundle;
import android.support.annotation.Nullable; import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity; import android.support.v7.app.AppCompatActivity;
import android.view.View;
import butterknife.ButterKnife; import butterknife.ButterKnife;
...@@ -19,6 +21,7 @@ public abstract class BaseActivity extends AppCompatActivity { ...@@ -19,6 +21,7 @@ public abstract class BaseActivity extends AppCompatActivity {
protected void onCreate(@Nullable Bundle savedInstanceState) { protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
setContentView(getContentView()); setContentView(getContentView());
setStatus();
myApplication.addActivity(this); myApplication.addActivity(this);
ButterKnife.bind(this); ButterKnife.bind(this);
initAction(); initAction();
...@@ -51,4 +54,11 @@ public abstract class BaseActivity extends AppCompatActivity { ...@@ -51,4 +54,11 @@ public abstract class BaseActivity extends AppCompatActivity {
} }
} }
private void setStatus(){
View decorView = getWindow().getDecorView();
int option = View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
| View.SYSTEM_UI_FLAG_LAYOUT_STABLE;
decorView.setSystemUiVisibility(option);
getWindow().setStatusBarColor(Color.TRANSPARENT);
}
} }
...@@ -8,8 +8,10 @@ import android.content.Context; ...@@ -8,8 +8,10 @@ import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.content.pm.PackageInfo; import android.content.pm.PackageInfo;
import android.content.pm.PackageManager; import android.content.pm.PackageManager;
import android.graphics.Color;
import android.os.BatteryManager; import android.os.BatteryManager;
import android.os.Build; import android.os.Build;
import android.support.v4.app.ActivityCompat;
import android.support.v7.app.NotificationCompat; import android.support.v7.app.NotificationCompat;
import android.text.TextUtils; import android.text.TextUtils;
import android.util.Log; import android.util.Log;
...@@ -25,6 +27,8 @@ import com.xf.weixinclick.http.HttpClientApi; ...@@ -25,6 +27,8 @@ import com.xf.weixinclick.http.HttpClientApi;
import com.xf.weixinclick.http.HttpSubscriber; import com.xf.weixinclick.http.HttpSubscriber;
import com.xf.weixinclick.receiver.WeChatStatus; import com.xf.weixinclick.receiver.WeChatStatus;
import com.xf.weixinclick.utils.SP; import com.xf.weixinclick.utils.SP;
import com.xf.weixinclick.view.WaveHelper;
import com.xf.weixinclick.view.WaveView;
import org.greenrobot.eventbus.EventBus; import org.greenrobot.eventbus.EventBus;
...@@ -54,6 +58,10 @@ public class MainActivity extends BaseActivity { ...@@ -54,6 +58,10 @@ public class MainActivity extends BaseActivity {
@BindView(R.id.tv_version_name) @BindView(R.id.tv_version_name)
TextView tv_version_name; TextView tv_version_name;
@BindView(R.id.waveView)
WaveView mWaveView;
WaveHelper mWaveHelper;
@Override @Override
int getContentView() { int getContentView() {
return R.layout.activity_main; return R.layout.activity_main;
...@@ -61,7 +69,11 @@ public class MainActivity extends BaseActivity { ...@@ -61,7 +69,11 @@ public class MainActivity extends BaseActivity {
@Override @Override
void initAction() { void initAction() {
Log.d("fei","测试下魅族log"); int waveColor = ActivityCompat.getColor(MainActivity.this,R.color.wave);
mWaveView.setWaveColor(waveColor,waveColor);
mWaveHelper = new WaveHelper(mWaveView);
HeartBeatAction.get().start(); HeartBeatAction.get().start();
...@@ -175,5 +187,19 @@ public class MainActivity extends BaseActivity { ...@@ -175,5 +187,19 @@ public class MainActivity extends BaseActivity {
} }
@Override
protected void onResume() {
super.onResume();
if (mWaveHelper != null){
mWaveHelper.start();
}
}
@Override
protected void onPause() {
super.onPause();
if (mWaveHelper != null) {
mWaveHelper.cancel();
}
}
} }
...@@ -4,6 +4,7 @@ import android.content.Context; ...@@ -4,6 +4,7 @@ import android.content.Context;
import android.content.res.TypedArray; import android.content.res.TypedArray;
import android.graphics.Rect; import android.graphics.Rect;
import android.graphics.drawable.Drawable; import android.graphics.drawable.Drawable;
import android.support.v7.widget.AppCompatEditText;
import android.text.Editable; import android.text.Editable;
import android.text.TextWatcher; import android.text.TextWatcher;
import android.text.method.HideReturnsTransformationMethod; import android.text.method.HideReturnsTransformationMethod;
...@@ -21,7 +22,7 @@ import java.util.ArrayList; ...@@ -21,7 +22,7 @@ import java.util.ArrayList;
import java.util.Collections; import java.util.Collections;
public class CustomEditText extends EditText { public class CustomEditText extends AppCompatEditText {
private static final String Tag = CustomEditText.class.getSimpleName(); private static final String Tag = CustomEditText.class.getSimpleName();
/** /**
......
package com.xf.weixinclick.view;
/**
* Created by Li on 2017/7/12.
*/
import android.animation.Animator;
import android.animation.AnimatorSet;
import android.animation.ObjectAnimator;
import android.animation.ValueAnimator;
import android.view.animation.LinearInterpolator;
import java.util.ArrayList;
import java.util.List;
public class WaveHelper {
private WaveView mWaveView;
private AnimatorSet mAnimatorSet;
public WaveHelper(WaveView waveView) {
mWaveView = waveView;
initAnimation();
}
public void start() {
mWaveView.setShowWave(true);
if (mAnimatorSet != null) {
mAnimatorSet.start();
}
}
private void initAnimation() {
List<Animator> animators = new ArrayList<>();
// horizontal animation.
// wave waves infinitely.
ObjectAnimator waveShiftAnim = ObjectAnimator.ofFloat(
mWaveView, "waveShiftRatio", 0f, 1f);
waveShiftAnim.setRepeatCount(ValueAnimator.INFINITE);
waveShiftAnim.setDuration(4000);
waveShiftAnim.setInterpolator(new LinearInterpolator());
animators.add(waveShiftAnim);
// // vertical animation.
// // water level increases from 0 to center of WaveView
// ObjectAnimator waterLevelAnim = ObjectAnimator.ofFloat(
// mWaveView, "waterLevelRatio", 0f, 0.5f);
// waterLevelAnim.setDuration(10000);
// waterLevelAnim.setInterpolator(new DecelerateInterpolator());
// animators.add(waterLevelAnim);
// amplitude animation.
// wave grows big then grows small, repeatedly
ObjectAnimator amplitudeAnim = ObjectAnimator.ofFloat(
mWaveView, "amplitudeRatio", 0.07f, 0.08f);
amplitudeAnim.setRepeatCount(ValueAnimator.INFINITE);
amplitudeAnim.setRepeatMode(ValueAnimator.REVERSE);
amplitudeAnim.setDuration(5000);
amplitudeAnim.setInterpolator(new LinearInterpolator());
animators.add(amplitudeAnim);
mAnimatorSet = new AnimatorSet();
mAnimatorSet.playTogether(animators);
}
public void cancel() {
if (mAnimatorSet != null) {
// mAnimatorSet.cancel();
mAnimatorSet.end();
}
}
}
<?xml version="1.0" encoding="utf-8"?>
<ripple android:color="@android:color/white"
xmlns:android="http://schemas.android.com/apk/res/android">
<item >
<shape android:shape="rectangle">
<corners android:radius="3dp"/>
<solid android:color="#1c978b" />
</shape>
</item>
</ripple>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<ripple android:color="@android:color/white"
xmlns:android="http://schemas.android.com/apk/res/android">
<item >
<shape android:shape="rectangle">
<corners android:radius="50dp"/>
<solid android:color="#19a89b" />
</shape>
</item>
</ripple>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape android:shape="rectangle"
xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="3dp"/>
<solid android:color="#1c978b" />
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape android:shape="rectangle"
xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="50dp"/>
<stroke android:color="@android:color/white" android:width="1px"/>
<solid android:color="#11ffffff" />
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android" <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="@drawable/bg" android:background="@drawable/bg"
android:fitsSystemWindows="true"
android:gravity="center_horizontal" android:gravity="center_horizontal"
android:orientation="vertical"> android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center_horizontal"
android:orientation="vertical">
<ImageView <ImageView
android:id="@+id/iv_click" android:id="@+id/iv_click"
...@@ -23,39 +18,39 @@ ...@@ -23,39 +18,39 @@
<com.xf.weixinclick.customerview.CustomEditText <com.xf.weixinclick.customerview.CustomEditText
android:id="@+id/et_phone" android:id="@+id/et_phone"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="50dp" android:layout_height="35dp"
android:layout_marginLeft="20dp" android:layout_marginLeft="40dp"
android:layout_marginRight="20dp" android:layout_marginRight="40dp"
android:layout_marginTop="20dp" android:layout_marginTop="50dp"
android:background="#00000000" android:background="@drawable/shape_edit_text"
android:drawablePadding="30dp" android:drawablePadding="30dp"
android:gravity="center_vertical" android:gravity="center_vertical"
android:hint="输入号码" android:hint="请输入用户名"
android:inputType="number" android:inputType="number"
android:paddingLeft="15dp" android:paddingLeft="15dp"
android:paddingRight="15dp" android:paddingRight="15dp"
android:textColor="#a503d6" android:textColor="@android:color/white"
android:textColorHint="#7d7d7d" android:textColorHint="@android:color/white"
android:textSize="16sp" /> android:textSize="12sp" />
<com.xf.weixinclick.customerview.CustomEditText <com.xf.weixinclick.customerview.CustomEditText
android:id="@+id/et_pwd" android:id="@+id/et_pwd"
android:layout_marginTop="10dp" android:layout_marginTop="10dp"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="50dp" android:layout_height="35dp"
android:layout_marginLeft="20dp" android:layout_marginLeft="40dp"
android:layout_marginRight="20dp" android:layout_marginRight="40dp"
android:background="#00000000" android:background="@drawable/shape_edit_text"
android:drawablePadding="30dp" android:drawablePadding="30dp"
android:gravity="center_vertical" android:gravity="center_vertical"
android:hint="密码" android:hint="请输入密码"
android:paddingLeft="15dp" android:paddingLeft="15dp"
android:paddingRight="15dp" android:paddingRight="15dp"
android:password="true" android:inputType="textPassword"
android:textColor="#a503d6" android:textColor="@android:color/white"
android:textColorHint="#7d7d7d" android:textColorHint="@android:color/white"
android:textSize="16sp" /> android:textSize="12sp" />
<View <View
android:layout_width="match_parent" android:layout_width="match_parent"
...@@ -64,14 +59,14 @@ ...@@ -64,14 +59,14 @@
android:layout_marginRight="20dp" android:layout_marginRight="20dp"
android:background="#7d7d7d" /> android:background="#7d7d7d" />
<TextView <Button
android:id="@+id/btn_login" android:id="@+id/btn_login"
android:background="@drawable/btn_login_bg_ripple"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="40dp" android:layout_height="35dp"
android:layout_marginLeft="40dp" android:layout_marginLeft="40dp"
android:layout_marginRight="40dp" android:layout_marginRight="40dp"
android:layout_marginTop="35dp" android:layout_marginTop="35dp"
android:background="#a503d6"
android:gravity="center" android:gravity="center"
android:text="登录" android:text="登录"
android:textColor="#fff" android:textColor="#fff"
...@@ -95,5 +90,4 @@ ...@@ -95,5 +90,4 @@
android:gravity="center" android:gravity="center"
android:text="设置" android:text="设置"
android:visibility="gone" /> android:visibility="gone" />
</LinearLayout> </LinearLayout>
</android.support.design.widget.CoordinatorLayout> \ No newline at end of file
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android" <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:orientation="vertical"> android:orientation="vertical">
<LinearLayout <RelativeLayout
android:orientation="vertical" android:fitsSystemWindows="true"
android:background="#19a99a"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="175dp">
<com.xf.weixinclick.view.WaveView
<com.xf.weixinclick.customerview.CustomEditText android:id="@+id/waveView"
android:id="@+id/cet_bind_user" android:layout_alignParentBottom="true"
android:gravity="center_vertical"
android:padding="5dp"
android:singleLine="true"
android:textSize="20sp"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="90dp" /> android:layout_height="100dp" />
<TextView <TextView
android:id="@+id/tv_bind" android:text="网家"
android:text="绑定" android:layout_marginTop="15dp"
android:textSize="50sp" android:textSize="16sp"
android:background="#00cccc" android:textColor="@android:color/white"
android:textColor="#ff00ff" android:layout_centerHorizontal="true"
android:gravity="center" android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<LinearLayout
android:orientation="horizontal"
android:layout_centerVertical="true"
android:layout_marginRight="15dp"
android:layout_marginTop="15dp"
android:layout_marginLeft="15dp"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="100dp" /> android:layout_height="wrap_content">
<com.xf.weixinclick.customerview.CustomEditText
android:id="@+id/cet_bind_user"
android:background="@drawable/shape_edit_id"
android:gravity="left"
android:padding="5dp"
android:singleLine="true"
android:textSize="12sp"
android:textColor="@android:color/white"
android:layout_marginRight="15dp"
android:layout_weight="1"
android:layout_width="0dp"
android:layout_height="30dp" />
<TextView
android:id="@+id/tv_bind"
android:text="绑定"
android:textSize="14sp"
android:background="@drawable/btn_bind"
android:textColor="@android:color/white"
android:gravity="center"
android:layout_width="60dp"
android:layout_height="30dp" />
</LinearLayout>
</RelativeLayout>
<TextView
android:text="设置"
android:textSize="16sp"
android:textColor="#c9c9ca"
android:layout_marginTop="15dp"
android:layout_marginLeft="15dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<RelativeLayout
android:layout_marginTop="15dp"
android:layout_marginLeft="15dp"
android:layout_marginRight="15dp"
android:background="@drawable/bg_work_action"
android:layout_width="match_parent"
android:layout_height="100dp">
<TextView <TextView
android:id="@+id/chat_view" android:id="@+id/chat_view"
android:text="开启监听" android:text="开启监听"
android:gravity="center" android:gravity="center"
android:textSize="50sp" android:textSize="14sp"
android:textColor="#000" android:textColor="#fd7f5f"
android:layout_width="match_parent" android:layout_centerInParent="true"
android:layout_height="100dp" android:layout_width="wrap_content"
android:background="#fff000"/> android:layout_height="wrap_content"
android:background="@drawable/bg_btn_wok_action"/>
</RelativeLayout>
<RelativeLayout
android:layout_marginTop="15dp"
android:layout_marginLeft="15dp"
android:layout_marginRight="15dp"
android:background="@drawable/bg_work_action"
android:layout_width="match_parent"
android:layout_height="100dp">
<TextView <TextView
android:id="@+id/chat_view_show" android:id="@+id/chat_view_show"
android:text="设置事件" android:text="设置事件"
android:gravity="center" android:gravity="center"
android:textSize="50sp" android:textSize="14sp"
android:textColor="#fff" android:textColor="#fd7f5f"
android:layout_width="match_parent" android:layout_centerInParent="true"
android:layout_height="100dp" android:layout_width="wrap_content"
android:background="#ff6600"/> android:layout_height="wrap_content"
android:background="@drawable/bg_btn_wok_action"/>
</RelativeLayout>
<TextView
android:id="@+id/tv_version_name"
android:layout_marginTop="@dimen/text_margin"
android:layout_marginLeft="@dimen/text_margin"
<RelativeLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="20dp" android:layout_height="match_parent">
tools:text="版本号" /> <TextView
</LinearLayout> android:id="@+id/tv_version_name"
android:layout_marginBottom="15dp"
android:layout_centerHorizontal="true"
android:layout_alignParentBottom="true"
android:textSize="16sp"
android:textColor="#c9c9ca"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
tools:text="版本号" />
</RelativeLayout>
</android.support.design.widget.CoordinatorLayout> </LinearLayout>
<resources>
<style name="AppTheme" parent="@style/BaseAppTheme">
</style>
</resources>
...@@ -3,4 +3,6 @@ ...@@ -3,4 +3,6 @@
<color name="colorPrimary">#3F51B5</color> <color name="colorPrimary">#3F51B5</color>
<color name="colorPrimaryDark">#303F9F</color> <color name="colorPrimaryDark">#303F9F</color>
<color name="colorAccent">#FF4081</color> <color name="colorAccent">#FF4081</color>
<color name="windowBg">#edf0f0</color>
<color name="wave">#08FFFFFF</color>
</resources> </resources>
<resources> <resources>
<!-- Base application theme. --> <!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar"> <style name="BaseAppTheme" parent="Theme.AppCompat.Light.NoActionBar">
<!-- Customize your theme here. --> <!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item> <item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item> <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item> <item name="colorAccent">@color/colorAccent</item>
<item name="windowActionBar">false</item> //很重要 <item name="android:windowBackground">@color/windowBg</item>
<item name="windowNoTitle">true</item> //很重要 </style>
<style name="AppTheme" parent="@style/BaseAppTheme">
</style> </style>
<declare-styleable name="customedt"> <declare-styleable name="customedt">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment