|
|
@@ -1,17 +1,12 @@
|
|
|
package com.modular.booking.activity.services;
|
|
|
|
|
|
import android.content.Intent;
|
|
|
-import android.graphics.Color;
|
|
|
import android.graphics.drawable.Drawable;
|
|
|
-import android.os.Build;
|
|
|
import android.os.Bundle;
|
|
|
import android.os.Handler;
|
|
|
import android.support.v7.app.ActionBar;
|
|
|
import android.view.LayoutInflater;
|
|
|
import android.view.View;
|
|
|
-import android.view.Window;
|
|
|
-import android.view.WindowManager;
|
|
|
-import android.widget.AbsListView;
|
|
|
import android.widget.AdapterView;
|
|
|
import android.widget.ImageView;
|
|
|
import android.widget.ListView;
|
|
|
@@ -66,22 +61,22 @@ public class BServicesActivity extends OABaseActivity implements View.OnClickLis
|
|
|
protected void onCreate(Bundle savedInstanceState) {
|
|
|
// getWindow().requestFeature(Window.FEATURE_ACTION_BAR_OVERLAY);
|
|
|
super.onCreate(savedInstanceState);
|
|
|
- if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
|
|
|
- Window window = getWindow();
|
|
|
- // window.addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
|
|
|
- window.addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION);
|
|
|
- }
|
|
|
- if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
|
|
- Window window = getWindow();
|
|
|
- window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS
|
|
|
- | WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION);
|
|
|
- window.getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
|
|
|
- | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
|
|
|
- | View.SYSTEM_UI_FLAG_LAYOUT_STABLE);
|
|
|
- window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
|
|
|
- //window.setStatusBarColor(Color.TRANSPARENT);
|
|
|
- window.setNavigationBarColor(Color.TRANSPARENT);
|
|
|
- }
|
|
|
+// if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
|
|
|
+// Window window = getWindow();
|
|
|
+// // window.addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
|
|
|
+// window.addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION);
|
|
|
+// }
|
|
|
+// if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
|
|
+// Window window = getWindow();
|
|
|
+// window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS
|
|
|
+// | WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION);
|
|
|
+// window.getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
|
|
|
+// | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
|
|
|
+// | View.SYSTEM_UI_FLAG_LAYOUT_STABLE);
|
|
|
+// window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
|
|
|
+// //window.setStatusBarColor(Color.TRANSPARENT);
|
|
|
+// window.setNavigationBarColor(Color.TRANSPARENT);
|
|
|
+// }
|
|
|
|
|
|
setContentView(R.layout.activity_bservices);
|
|
|
|
|
|
@@ -178,18 +173,18 @@ public class BServicesActivity extends OABaseActivity implements View.OnClickLis
|
|
|
@Override
|
|
|
protected void onResume() {
|
|
|
super.onResume();
|
|
|
- drawBg.setAlpha(80);
|
|
|
+// drawBg.setAlpha(80);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public void onBackPressed() {
|
|
|
super.onBackPressed();
|
|
|
- new Handler().postDelayed(new Runnable() {
|
|
|
- @Override
|
|
|
- public void run() {
|
|
|
- drawBg.setAlpha(255);
|
|
|
- }
|
|
|
- },10);
|
|
|
+// new Handler().postDelayed(new Runnable() {
|
|
|
+// @Override
|
|
|
+// public void run() {
|
|
|
+// drawBg.setAlpha(255);
|
|
|
+// }
|
|
|
+// },10);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
@@ -235,46 +230,46 @@ public class BServicesActivity extends OABaseActivity implements View.OnClickLis
|
|
|
}
|
|
|
});
|
|
|
//监听滚动事件
|
|
|
- mListView.setOnScrollListener(new AbsListView.OnScrollListener() {
|
|
|
- private int DISTANCE =900;
|
|
|
-
|
|
|
- @Override
|
|
|
- public void onScrollStateChanged(AbsListView view, int scrollState) {
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- @Override
|
|
|
- public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount) {
|
|
|
- int offset = 0;
|
|
|
- if (firstVisibleItem == 0||firstVisibleItem==1) {
|
|
|
- View firstItem = mListView.getRefreshableView().getChildAt(0);
|
|
|
- if (firstItem != null) {
|
|
|
- offset = 0 - firstItem.getTop()+120;
|
|
|
- }
|
|
|
- } else {
|
|
|
- offset =DISTANCE-1;
|
|
|
- }
|
|
|
-
|
|
|
- float percent = (offset * 1f) / (DISTANCE * 1f) ;
|
|
|
- if (percent >=0 && percent < 1) {
|
|
|
- drawBg.setAlpha((int)(percent *255));
|
|
|
- if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
|
|
- getWindow().setStatusBarColor(getResources().getColor(R.color.antionbarcolor));
|
|
|
- }
|
|
|
- }else if(percent>=1&&firstVisibleItem!=1){
|
|
|
- drawBg.setAlpha((int)(percent *255));
|
|
|
- if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
|
|
- getWindow().setStatusBarColor(getResources().getColor(R.color.antionbarcolor));
|
|
|
- }
|
|
|
- }else if(percent==1){
|
|
|
- drawBg.setAlpha(255);
|
|
|
- }
|
|
|
- LogUtil.d(TAG,"offset:"+offset);
|
|
|
- LogUtil.d(TAG,"percent:"+(int)(percent *255));
|
|
|
-
|
|
|
-
|
|
|
- }
|
|
|
- });
|
|
|
+// mListView.setOnScrollListener(new AbsListView.OnScrollListener() {
|
|
|
+// private int DISTANCE =900;
|
|
|
+//
|
|
|
+// @Override
|
|
|
+// public void onScrollStateChanged(AbsListView view, int scrollState) {
|
|
|
+//
|
|
|
+// }
|
|
|
+//
|
|
|
+// @Override
|
|
|
+// public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount) {
|
|
|
+// int offset = 0;
|
|
|
+// if (firstVisibleItem == 0||firstVisibleItem==1) {
|
|
|
+// View firstItem = mListView.getRefreshableView().getChildAt(0);
|
|
|
+// if (firstItem != null) {
|
|
|
+// offset = 0 - firstItem.getTop()+120;
|
|
|
+// }
|
|
|
+// } else {
|
|
|
+// offset =DISTANCE-1;
|
|
|
+// }
|
|
|
+//
|
|
|
+// float percent = (offset * 1f) / (DISTANCE * 1f) ;
|
|
|
+// if (percent >=0 && percent < 1) {
|
|
|
+// drawBg.setAlpha((int)(percent *255));
|
|
|
+// if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
|
|
+// getWindow().setStatusBarColor(getResources().getColor(R.color.antionbarcolor));
|
|
|
+// }
|
|
|
+// }else if(percent>=1&&firstVisibleItem!=1){
|
|
|
+// drawBg.setAlpha((int)(percent *255));
|
|
|
+// if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
|
|
+// getWindow().setStatusBarColor(getResources().getColor(R.color.antionbarcolor));
|
|
|
+// }
|
|
|
+// }else if(percent==1){
|
|
|
+// drawBg.setAlpha(255);
|
|
|
+// }
|
|
|
+// LogUtil.d(TAG,"offset:"+offset);
|
|
|
+// LogUtil.d(TAG,"percent:"+(int)(percent *255));
|
|
|
+//
|
|
|
+//
|
|
|
+// }
|
|
|
+// });
|
|
|
|
|
|
mBackImageView.setOnClickListener(this);
|
|
|
mSearchTv.setOnClickListener(this);
|