@@ -27,11 +27,13 @@ import android.widget.Toast; |
||
27 | 27 |
|
28 | 28 |
import com.android.common.utils.DeviceUtils; |
29 | 29 |
import com.android.common.utils.LogHelper; |
30 |
+import com.android.common.utils.TimeUtils; |
|
30 | 31 |
import com.android.views.indicators.Indicator; |
31 | 32 |
import com.android.views.indicators.IndicatorViewPager; |
32 | 33 |
import com.android.views.indicators.SpringBar; |
33 | 34 |
|
34 | 35 |
import java.io.File; |
36 |
+import java.sql.Time; |
|
35 | 37 |
|
36 | 38 |
import ai.pai.client.R; |
37 | 39 |
import ai.pai.client.beans.GroupInfo; |
@@ -58,6 +60,7 @@ public class MainActivity extends AppCompatActivity |
||
58 | 60 |
private String guideId; |
59 | 61 |
private PersonInfoPopup personInfoPopup; |
60 | 62 |
private ImageButton callGuideBtn; |
63 |
+ private ImageButton gatherBtn; |
|
61 | 64 |
@Override |
62 | 65 |
protected void onCreate(Bundle savedInstanceState) { |
63 | 66 |
super.onCreate(savedInstanceState); |
@@ -89,8 +92,10 @@ public class MainActivity extends AppCompatActivity |
||
89 | 92 |
PhotoLoader.getInstance(this).displayImage(Preferences.getInstance(this).getUserAvatar(), drawerToggle,PhotoLoader.getUserAvatarOptions()); |
90 | 93 |
drawerToggle.setOnClickListener(this); |
91 | 94 |
callGuideBtn = (ImageButton)findViewById(R.id.floating_btn_call); |
95 |
+ gatherBtn = (ImageButton)findViewById(R.id.floating_btn_gather); |
|
92 | 96 |
findViewById(R.id.floating_btn_add).setOnClickListener(this); |
93 | 97 |
findViewById(R.id.floating_btn_scan).setOnClickListener(this); |
98 |
+ gatherBtn.setOnClickListener(this); |
|
94 | 99 |
callGuideBtn.setOnClickListener(this); |
95 | 100 |
} |
96 | 101 |
|
@@ -98,6 +103,7 @@ public class MainActivity extends AppCompatActivity |
||
98 | 103 |
protected void onResume() { |
99 | 104 |
super.onResume(); |
100 | 105 |
callGuideBtn.setVisibility(TextUtils.isEmpty(Preferences.getInstance(this).getTourGuidePhone()) ? View.INVISIBLE : View.VISIBLE); |
106 |
+ gatherBtn.setVisibility(Preferences.getInstance(this).getGatherTime()<System.currentTimeMillis() ? View.INVISIBLE : View.VISIBLE); |
|
101 | 107 |
} |
102 | 108 |
|
103 | 109 |
|
@@ -169,6 +175,9 @@ public class MainActivity extends AppCompatActivity |
||
169 | 175 |
@Override |
170 | 176 |
public void onClick(View v) { |
171 | 177 |
switch (v.getId()) { |
178 |
+ case R.id.floating_btn_gather: |
|
179 |
+ Toast.makeText(MainActivity.this, TimeUtils.getGatherTimeStr(Preferences.getInstance(this).getGatherTime()),Toast.LENGTH_SHORT).show(); |
|
180 |
+ break; |
|
172 | 181 |
case R.id.floating_btn_add: |
173 | 182 |
new GroupSelectPopup(MainActivity.this).showPopupWindow(); |
174 | 183 |
break; |
@@ -339,7 +339,7 @@ public class TabRecentPhotoFragment extends BaseFragment implements SwipeRefresh |
||
339 | 339 |
@Override |
340 | 340 |
public View createView(Context context) { |
341 | 341 |
imageView = new ImageView(context); |
342 |
- imageView.setScaleType(ImageView.ScaleType.FIT_XY); |
|
342 |
+ imageView.setScaleType(ImageView.ScaleType.CENTER_CROP); |
|
343 | 343 |
return imageView; |
344 | 344 |
} |
345 | 345 |
|
@@ -31,10 +31,23 @@ |
||
31 | 31 |
android:id="@+id/floating_btn_call" |
32 | 32 |
android:layout_width="56dp" |
33 | 33 |
android:layout_height="56dp" |
34 |
- android:layout_gravity="bottom|end" |
|
35 |
- android:layout_marginRight="8dp" |
|
36 |
- android:layout_marginBottom="124dp" |
|
37 |
- android:background="@drawable/call_guide"/> |
|
34 |
+ android:layout_gravity="bottom|start" |
|
35 |
+ android:layout_marginLeft="8dp" |
|
36 |
+ android:layout_marginBottom="6dp" |
|
37 |
+ android:layout_marginTop="3dp" |
|
38 |
+ android:background="@drawable/call_guide" |
|
39 |
+ android:visibility="invisible"/> |
|
40 |
+ |
|
41 |
+ <ImageButton |
|
42 |
+ android:id="@+id/floating_btn_gather" |
|
43 |
+ android:layout_width="56dp" |
|
44 |
+ android:layout_height="56dp" |
|
45 |
+ android:layout_gravity="bottom|start" |
|
46 |
+ android:layout_marginLeft="8dp" |
|
47 |
+ android:layout_marginBottom="66dp" |
|
48 |
+ android:visibility="invisible" |
|
49 |
+ android:background="@drawable/ic_gather"/> |
|
50 |
+ |
|
38 | 51 |
|
39 | 52 |
|
40 | 53 |
</android.support.design.widget.CoordinatorLayout> |
@@ -33,6 +33,16 @@ public class TimeUtils { |
||
33 | 33 |
|
34 | 34 |
private static final String YEARS_SUFFIX = "年前"; |
35 | 35 |
|
36 |
+ public static String getGatherTimeStr(long gatherTime){ |
|
37 |
+ String gatherStr = ""; |
|
38 |
+ try{ |
|
39 |
+ SimpleDateFormat localFormatter = new SimpleDateFormat("HH:mm"); |
|
40 |
+ gatherStr = localFormatter.format(gatherTime); |
|
41 |
+ }catch (Exception e){ |
|
42 |
+ e.printStackTrace(); |
|
43 |
+ } |
|
44 |
+ return gatherStr; |
|
45 |
+ } |
|
36 | 46 |
|
37 | 47 |
public static String utc2Local(String utcTime, String utcTimePatten, |
38 | 48 |
String localTimePatten) { |