n rel="diff-3f8145131151518bdb061d057144b2cd240843abL73">73
-        checkBoxUpgradeInfoInteractor = new CheckBoxUpgradeInfoInteractor(lensmanId,this);
74 69
         uploadServiceConnection = new ServiceConnection() {
75 70
             @Override
76 71
             public void onServiceConnected(ComponentName componentName, IBinder iBinder) {
@@ -105,14 +100,10 @@ class MainPresenter implements MainContract.Presenter,SyncTimeInteractor.SyncTim
105 100
             view.showBoxDisconnectedView();
106 101
         }
107 102
         view.setNewSessionBtnEnabled(false);
108
-        view.showTimeSyncView();
109 103
         if(!isTimeSync){
110 104
             syncTimeInteractor.startJob();
111 105
         }
112 106
         boxStatusInteractor.startJob();
113
-        if(!isBoxUpdateChecked){
114
-            checkBoxUpgradeInfoInteractor.startJob();
115
-        }
116 107
         registerWifiChangeReceiver();
117 108
         App.getAppContext().startService(new Intent(App.getAppContext(), OrderDealService.class));
118 109
         App.getAppContext().bindService(new Intent(App.getAppContext(),OrderDealService.class),
@@ -126,9 +117,6 @@ class MainPresenter implements MainContract.Presenter,SyncTimeInteractor.SyncTim
126 117
     }
127 118
 
128 119
     private void onDataReady(){
129
-        if(!isTimeSync){
130
-            return;
131
-        }
132 120
         view.setNewSessionBtnEnabled(true);
133 121
         if(sessionList.size()==0){
134 122
             view.showEmptyView();
@@ -142,8 +130,7 @@ class MainPresenter implements MainContract.Presenter,SyncTimeInteractor.SyncTim
142 130
     @Override
143 131
     public void stop() {
144 132
         boxStatusInteractor.cancelJob();
145
-        syncTimeInteractor.cancelJob();
146
-        checkBoxUpgradeInfoInteractor.cancelJob();
133
+//        syncTimeInteractor.cancelJob();
147 134
         App.getAppContext().unbindService(uploadServiceConnection);
148 135
         App.getAppContext().unbindService(orderServiceConnection);
149 136
         App.getAppContext().unregisterReceiver(wifiReceiver);
@@ -162,13 +149,6 @@ class MainPresenter implements MainContract.Presenter,SyncTimeInteractor.SyncTim
162 149
         return sessionBean;
163 150
     }
164 151
 
165
-    @Override
166
-    public void resyncTime() {
167
-        if(syncTimeInteractor!=null){
168
-            syncTimeInteractor.cancelJob();
169
-            syncTimeInteractor.startJob();
170
-        }
171
-    }
172 152
 
173 153
     private long getSessionDateInLongFormat(){
174 154
         SimpleDateFormat format = new SimpleDateFormat("yyyyMMdd");
@@ -255,21 +235,6 @@ class MainPresenter implements MainContract.Presenter,SyncTimeInteractor.SyncTim
255 235
     @Override
256 236
     public void onTimeSync(boolean result, @StringRes int strId) {
257 237
         isTimeSync = result;
258
-        if(result){
259
-            onDataReady();
260
-        }else{
261
-            if(strId!=0){
262
-                view.showRetrySyncView(strId);
263
-            }
264
-        }
265
-    }
266
-
267
-    @Override
268
-    public void onUpgradeInfoFetched(boolean result, String bpversion_str,int versionCode) {
269
-        isBoxUpdateChecked = true;
270
-        if(result){
271
-            view.showBoxUpgradeActivity(bpversion_str,versionCode);
272
-        }
273 238
     }
274 239
 
275 240
 }

+ 4 - 1
app/src/main/res/layout/activity_briefs.xml

@@ -450,12 +450,15 @@
450 450
                 <View
451 451
                     android:layout_width="match_parent"
452 452
                     android:layout_height="1px"
453
+                    android:visibility="gone"
453 454
                     android:background="@color/text_hint_grey_color" />
454 455
 
455 456
                 <LinearLayout
456 457
                     android:layout_width="match_parent"
457 458
                     android:layout_height="44dp"
458
-                    android:orientation="horizontal">
459
+                    android:orientation="horizontal"
460
+                    android:visibility="gone"
461
+                    >
459 462
 
460 463
                     <TextView
461 464
                         android:layout_width="wrap_content"

+ 0 - 40
app/src/main/res/layout/activity_main.xml

@@ -56,46 +56,6 @@
56 56
         android:layout_centerInParent="true"
57 57
         android:src="@drawable/no_photo_tip" />
58 58
 
59
-    <RelativeLayout
60
-        android:id="@+id/sync_time_view"
61
-        android:layout_width="match_parent"
62
-        android:layout_height="match_parent"
63
-        android:background="@color/half_transparent">
64
-
65
-        <com.android.views.loadingdrawable.LoadingView
66
-            android:id="@+id/loading_gear_view"
67
-            android:layout_width="180dp"
68
-            android:layout_height="180dp"
69
-            android:layout_centerInParent="true"
70
-            app:loading_renderer="GearLoadingRenderer"/>
71
-
72
-        <TextView
73
-            android:id="@+id/tv_sync_time_status"
74
-            android:layout_width="wrap_content"
75
-            android:layout_height="wrap_content"
76
-            android:textSize="16sp"
77
-            android:text="@string/time_syncing"
78
-            android:layout_below="@id/loading_gear_view"
79
-            android:layout_marginTop="10dp"
80
-            android:layout_centerHorizontal="true"
81
-            android:textColor="@color/white"/>
82
-
83
-        <Button
84
-            android:id="@+id/btn_retry_sync"
85
-            android:layout_width="140dp"
86
-            android:layout_height="40dp"
87
-            android:layout_centerHorizontal="true"
88
-            android:layout_below="@id/tv_sync_time_status"
89
-            android:layout_marginTop="10dp"
90
-            android:background="@drawable/retry_sync_btn_rounded_rect_bg"
91
-            android:gravity="center"
92
-            android:text="@string/time_sync_retry"
93
-            android:textColor="@color/white"
94
-            android:visibility="gone"
95
-            android:textSize="18sp" />
96
-    </RelativeLayout>
97
-
98
-
99 59
     <android.support.v7.widget.RecyclerView
100 60
         android:id="@+id/recycler_view_sessions"
101 61
         android:layout_width="match_parent"

pai2 - Gogs: Go Git Service

拍爱

models.py 4.5KB

    # -*- coding: utf-8 -*- import datetime import os import time from django.conf import settings from django.db import models from django.utils.translation import ugettext_lazy as _ from pai2.basemodels import CreateUpdateMixin, PlatformMixin, VersionMixin def upload_path(instance, old_filename): extension = os.path.splitext(old_filename)[1].lower() today = datetime.datetime.today() return 'file/{year}{month}/{timestamp}{extension}'.format( year=today.year, month=today.month, timestamp=int(time.time()), extension=extension ) class LatestAppInfo(CreateUpdateMixin): latest_adr_version_code = models.IntegerField(_(u'latest_adr_version_code'), default=0, help_text=u'最新安卓版本号') latest_adr_version_name = models.CharField(_(u'latest_adr_version_name'), max_length=255, blank=True, null=True, help_text=u'最新安卓版本名') latest_adr_app = models.FileField(_(u'latest_adr_app'), upload_to=upload_path, blank=True, null=True, help_text=u'最新版安卓 APP') latest_adr_url = models.URLField(_(u'latest_adr_url'), max_length=255, blank=True, null=True, help_text=u'最新版 APP 链接') latest_ios_version_code = models.IntegerField(_(u'latest_ios_version_code'), default=0, help_text=u'最新 iOS 版本号') latest_ios_version_name = models.CharField(_(u'latest_ios_version_name'), max_length=255, blank=True, null=True, help_text=u'最新 iOS 版本名') latest_ios_url = models.URLField(_(u'latest_ios_url'), max_length=255, blank=True, null=True, help_text=u'最新版 iOS 链接') class Meta: verbose_name = _('latestappinfo') verbose_name_plural = _('latestappinfo') def __unicode__(self): return u'{0.pk}'.format(self) @property def final_latest_adr_url(self): return self.latest_adr_url or u'{}{}'.format(settings.DOMAIN, self.latest_adr_app and self.latest_adr_app.url) @property def data(self): return { 'latest_adr_version_code': self.latest_adr_version_code, 'latest_adr_version_name': self.latest_adr_version_name, 'latest_adr_url': self.final_latest_adr_url, 'latest_ios_version_code': self.latest_ios_version_code, 'latest_ios_version_name': self.latest_ios_version_name, 'latest_ios_url': self.latest_ios_url, } class SplashInfo(CreateUpdateMixin): splash_image = models.ImageField(_(u'splash_image'), upload_to=upload_path, blank=True, null=True, help_text=u'启动页面图片') spalash_image_airtime = models.DateTimeField(_(u'spalash_image_airtime'), blank=True, null=True, help_text=u'启动页面图片开始日期') spalash_image_deadline = models.DateTimeField(_(u'spalash_image_deadline'), blank=True, null=True, help_text=u'启动页面图片截止日期') class Meta: verbose_name = _('splashinfo') verbose_name_plural = _('splashinfo') def __unicode__(self): return u'{0.pk}'.format(self) @property def splash_image_url(self): return self.splash_image and (settings.DOMAIN + self.splash_image.url) @property def data(self): return { 'splash_image_url': self.splash_image_url, 'spalash_image_airtime': self.spalash_image_airtime, 'spalash_image_deadline': self.spalash_image_deadline, } class FeedbackInfo(CreateUpdateMixin): PAIAI_USER = 0 PAIAI_LENSMAN = 1 SRC = ( (PAIAI_USER, u'拍爱用户端'), (PAIAI_LENSMAN, u'拍爱摄影师端'), ) user_id = models.CharField(_(u'user_id'), max_length=255, blank=True, null=True, help_text=u'用户唯一标识') feedback = models.TextField(_(u'feedback'), blank=True, null=True, help_text=u'用户反馈') src = models.IntegerField(_(u'src'), choices=SRC, default=PAIAI_USER, help_text=u'用户反馈来源') class Meta: verbose_name = _('feedbackinfo') verbose_name_plural = _('feedbackinfo') def __unicode__(self): return u'{0.pk}'.format(self) class GuestEntranceControlInfo(CreateUpdateMixin, PlatformMixin, VersionMixin): class Meta: verbose_name = _('guestentrancecontrolinfo') verbose_name_plural = _('guestentrancecontrolinfo') def __unicode__(self): return u'{0.pk}'.format(self) @property def data(self): return { 'platform': self.platform, 'min_adr': self.min_adr, 'min_ios': self.min_ios, 'max_adr': self.max_adr, 'max_ios': self.max_ios, }