Showing
14 changed files
with
20 additions
and
56 deletions
| @@ -148,6 +148,12 @@ | @@ -148,6 +148,12 @@ | ||
| 148 | 148 | ||
| 149 | <activity android:name=".activity.QrCodeShowActivity"> | 149 | <activity android:name=".activity.QrCodeShowActivity"> |
| 150 | </activity> | 150 | </activity> |
| 151 | + | ||
| 152 | + <activity | ||
| 153 | + android:name="com.xgimi.gimicinema.activity.SwitchControlActivity" | ||
| 154 | + android:theme="@style/AppTheme.NoActionBar"> | ||
| 155 | + | ||
| 156 | + </activity> | ||
| 151 | </application> | 157 | </application> |
| 152 | 158 | ||
| 153 | </manifest> | 159 | </manifest> |
| @@ -22,7 +22,6 @@ import android.widget.Toast; | @@ -22,7 +22,6 @@ import android.widget.Toast; | ||
| 22 | import com.gimi.common.cinema.model.SambaMsg; | 22 | import com.gimi.common.cinema.model.SambaMsg; |
| 23 | import com.gimi.common.cinema.utils.T; | 23 | import com.gimi.common.cinema.utils.T; |
| 24 | import com.gimi.common.cinema.utils.WifiApManger; | 24 | import com.gimi.common.cinema.utils.WifiApManger; |
| 25 | -import com.qnbar.switchcontrol.SwitchControlActivity; | ||
| 26 | import com.xgimi.gimicinema.BuildConfig; | 25 | import com.xgimi.gimicinema.BuildConfig; |
| 27 | import com.xgimi.gimicinema.R; | 26 | import com.xgimi.gimicinema.R; |
| 28 | import com.xgimi.gimicinema.mview.ISettingView; | 27 | import com.xgimi.gimicinema.mview.ISettingView; |
| 1 | -package com.qnbar.switchcontrol; | 1 | +package com.xgimi.gimicinema.activity; |
| 2 | 2 | ||
| 3 | import android.graphics.Rect; | 3 | import android.graphics.Rect; |
| 4 | import android.os.Bundle; | 4 | import android.os.Bundle; |
| @@ -13,9 +13,10 @@ import com.adroplat.fist_switch.jni.FistJni; | @@ -13,9 +13,10 @@ import com.adroplat.fist_switch.jni.FistJni; | ||
| 13 | import com.adroplat.fist_switch.jni.SubDevice; | 13 | import com.adroplat.fist_switch.jni.SubDevice; |
| 14 | import com.adroplat.fist_switch.utils.protocol.one.FistProtocol; | 14 | import com.adroplat.fist_switch.utils.protocol.one.FistProtocol; |
| 15 | import com.google.gson.Gson; | 15 | import com.google.gson.Gson; |
| 16 | -import com.qnbar.switchcontrol.adapter.DeviceListAdapter; | ||
| 17 | -import com.qnbar.switchcontrol.adapter.SwitchListAdapter; | ||
| 18 | import com.qnbar.switchcontrol.model.SwitchMessageEvent; | 16 | import com.qnbar.switchcontrol.model.SwitchMessageEvent; |
| 17 | +import com.xgimi.gimicinema.R; | ||
| 18 | +import com.xgimi.gimicinema.adapter.DeviceListAdapter; | ||
| 19 | +import com.xgimi.gimicinema.adapter.SwitchListAdapter; | ||
| 19 | import org.greenrobot.eventbus.EventBus; | 20 | import org.greenrobot.eventbus.EventBus; |
| 20 | import org.greenrobot.eventbus.Subscribe; | 21 | import org.greenrobot.eventbus.Subscribe; |
| 21 | import org.greenrobot.eventbus.ThreadMode; | 22 | import org.greenrobot.eventbus.ThreadMode; |
| @@ -28,14 +29,8 @@ public class SwitchControlActivity extends AppCompatActivity { | @@ -28,14 +29,8 @@ public class SwitchControlActivity extends AppCompatActivity { | ||
| 28 | @Override | 29 | @Override |
| 29 | protected void onCreate(Bundle savedInstanceState) { | 30 | protected void onCreate(Bundle savedInstanceState) { |
| 30 | super.onCreate(savedInstanceState); | 31 | super.onCreate(savedInstanceState); |
| 31 | - setContentView(R.layout.content_main); | ||
| 32 | -// Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); | ||
| 33 | -// setSupportActionBar(toolbar); | ||
| 34 | -// if (getSupportActionBar() != null) { | ||
| 35 | -// getSupportActionBar().setTitle("智能开关设置"); | ||
| 36 | -// } | 32 | + setContentView(R.layout.activity_switch_control); |
| 37 | EventBus.getDefault().register(this); | 33 | EventBus.getDefault().register(this); |
| 38 | - //EventBus,List of Hub,List of Lights | ||
| 39 | //TODO save DeviceNum,SubDeviceNum | 34 | //TODO save DeviceNum,SubDeviceNum |
| 40 | initList(); | 35 | initList(); |
| 41 | FistJni fistJni = FistJni.getInstance(); | 36 | FistJni fistJni = FistJni.getInstance(); |
| @@ -14,7 +14,7 @@ | @@ -14,7 +14,7 @@ | ||
| 14 | * limitations under the License. | 14 | * limitations under the License. |
| 15 | */ | 15 | */ |
| 16 | 16 | ||
| 17 | -package com.qnbar.switchcontrol.adapter; | 17 | +package com.xgimi.gimicinema.adapter; |
| 18 | 18 | ||
| 19 | import android.graphics.Color; | 19 | import android.graphics.Color; |
| 20 | import android.support.v7.widget.RecyclerView; | 20 | import android.support.v7.widget.RecyclerView; |
| @@ -26,7 +26,7 @@ import android.view.ViewGroup; | @@ -26,7 +26,7 @@ import android.view.ViewGroup; | ||
| 26 | import android.widget.TextView; | 26 | import android.widget.TextView; |
| 27 | import com.adroplat.fist_switch.jni.Device; | 27 | import com.adroplat.fist_switch.jni.Device; |
| 28 | import com.adroplat.fist_switch.jni.FistJni; | 28 | import com.adroplat.fist_switch.jni.FistJni; |
| 29 | -import com.qnbar.switchcontrol.R; | 29 | +import com.xgimi.gimicinema.R; |
| 30 | 30 | ||
| 31 | public class DeviceListAdapter extends RecyclerView.Adapter<DeviceListAdapter.DeviceHolder> | 31 | public class DeviceListAdapter extends RecyclerView.Adapter<DeviceListAdapter.DeviceHolder> |
| 32 | implements View.OnClickListener, View.OnLongClickListener { | 32 | implements View.OnClickListener, View.OnLongClickListener { |
| @@ -14,7 +14,7 @@ | @@ -14,7 +14,7 @@ | ||
| 14 | * limitations under the License. | 14 | * limitations under the License. |
| 15 | */ | 15 | */ |
| 16 | 16 | ||
| 17 | -package com.qnbar.switchcontrol.adapter; | 17 | +package com.xgimi.gimicinema.adapter; |
| 18 | 18 | ||
| 19 | import android.graphics.Color; | 19 | import android.graphics.Color; |
| 20 | import android.support.v7.widget.RecyclerView; | 20 | import android.support.v7.widget.RecyclerView; |
| @@ -26,7 +26,7 @@ import android.view.ViewGroup; | @@ -26,7 +26,7 @@ import android.view.ViewGroup; | ||
| 26 | import android.widget.TextView; | 26 | import android.widget.TextView; |
| 27 | import com.adroplat.fist_switch.jni.FistJni; | 27 | import com.adroplat.fist_switch.jni.FistJni; |
| 28 | import com.adroplat.fist_switch.jni.SubDevice; | 28 | import com.adroplat.fist_switch.jni.SubDevice; |
| 29 | -import com.qnbar.switchcontrol.R; | 29 | +import com.xgimi.gimicinema.R; |
| 30 | 30 | ||
| 31 | public class SwitchListAdapter extends RecyclerView.Adapter<SwitchListAdapter.DeviceHolder> | 31 | public class SwitchListAdapter extends RecyclerView.Adapter<SwitchListAdapter.DeviceHolder> |
| 32 | implements View.OnClickListener, View.OnLongClickListener { | 32 | implements View.OnClickListener, View.OnLongClickListener { |
| @@ -45,7 +45,7 @@ public class MainActivity extends Activity { | @@ -45,7 +45,7 @@ public class MainActivity extends Activity { | ||
| 45 | @Override | 45 | @Override |
| 46 | protected void onCreate(Bundle savedInstanceState) { | 46 | protected void onCreate(Bundle savedInstanceState) { |
| 47 | super.onCreate(savedInstanceState); | 47 | super.onCreate(savedInstanceState); |
| 48 | - setContentView(R.layout.content_main); | 48 | + setContentView(R.layout.activity_switch_control); |
| 49 | EventBus.getDefault().register(this); | 49 | EventBus.getDefault().register(this); |
| 50 | startService(new Intent(this, ConfigService.class)); | 50 | startService(new Intent(this, ConfigService.class)); |
| 51 | 51 |
| @@ -10,7 +10,7 @@ | @@ -10,7 +10,7 @@ | ||
| 10 | android:orientation="vertical" | 10 | android:orientation="vertical" |
| 11 | app:layout_behavior="@string/appbar_scrolling_view_behavior" | 11 | app:layout_behavior="@string/appbar_scrolling_view_behavior" |
| 12 | tools:showIn="@layout/activity_switch_control" | 12 | tools:showIn="@layout/activity_switch_control" |
| 13 | - tools:context="com.qnbar.switchcontrol.SwitchControlActivity"> | 13 | + tools:context=".activity.SwitchControlActivity"> |
| 14 | 14 | ||
| 15 | <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal"> | 15 | <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal"> |
| 16 | 16 |
| @@ -7,7 +7,7 @@ | @@ -7,7 +7,7 @@ | ||
| 7 | android:orientation="vertical" | 7 | android:orientation="vertical" |
| 8 | > | 8 | > |
| 9 | <ImageView android:layout_width="80dp" android:layout_height="80dp" | 9 | <ImageView android:layout_width="80dp" android:layout_height="80dp" |
| 10 | - android:background="@mipmap/host"/> | 10 | + android:background="@drawable/host"/> |
| 11 | <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" | 11 | <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" |
| 12 | android:id="@+id/deviceNumTv" | 12 | android:id="@+id/deviceNumTv" |
| 13 | android:textSize="16sp" | 13 | android:textSize="16sp" |
| @@ -20,6 +20,6 @@ | @@ -20,6 +20,6 @@ | ||
| 20 | 20 | ||
| 21 | </android.support.design.widget.AppBarLayout> | 21 | </android.support.design.widget.AppBarLayout> |
| 22 | 22 | ||
| 23 | - <include layout="@layout/content_main" /> | 23 | + <include layout="@layout/activity_switch_control" /> |
| 24 | 24 | ||
| 25 | </android.support.design.widget.CoordinatorLayout> | 25 | </android.support.design.widget.CoordinatorLayout> |
| @@ -7,7 +7,7 @@ | @@ -7,7 +7,7 @@ | ||
| 7 | android:orientation="vertical" | 7 | android:orientation="vertical" |
| 8 | > | 8 | > |
| 9 | <ImageView android:layout_width="80dp" android:layout_height="80dp" | 9 | <ImageView android:layout_width="80dp" android:layout_height="80dp" |
| 10 | - android:background="@mipmap/equipment_switch"/> | 10 | + android:background="@drawable/equipment_switch"/> |
| 11 | 11 | ||
| 12 | <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" | 12 | <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" |
| 13 | android:id="@+id/subDeviceNum" | 13 | android:id="@+id/subDeviceNum" |
| @@ -8,11 +8,7 @@ | @@ -8,11 +8,7 @@ | ||
| 8 | android:allowBackup="true" | 8 | android:allowBackup="true" |
| 9 | android:label="@string/app_name" | 9 | android:label="@string/app_name" |
| 10 | android:supportsRtl="true"> | 10 | android:supportsRtl="true"> |
| 11 | - <activity | ||
| 12 | - android:name=".SwitchControlActivity" | ||
| 13 | - android:theme="@style/AppTheme.NoActionBar"> | ||
| 14 | 11 | ||
| 15 | - </activity> | ||
| 16 | </application> | 12 | </application> |
| 17 | 13 | ||
| 18 | </manifest> | 14 | </manifest> |
| 1 | -<?xml version="1.0" encoding="utf-8"?> | ||
| 2 | -<android.support.design.widget.CoordinatorLayout | ||
| 3 | - xmlns:android="http://schemas.android.com/apk/res/android" | ||
| 4 | - xmlns:app="http://schemas.android.com/apk/res-auto" | ||
| 5 | - android:layout_width="match_parent" | ||
| 6 | - android:layout_height="match_parent"> | ||
| 7 | - | ||
| 8 | - <android.support.design.widget.AppBarLayout | ||
| 9 | - android:layout_height="wrap_content" | ||
| 10 | - android:layout_width="match_parent" | ||
| 11 | - android:theme="@style/AppTheme.AppBarOverlay"> | ||
| 12 | - | ||
| 13 | - <android.support.v7.widget.Toolbar | ||
| 14 | - android:id="@+id/toolbar" | ||
| 15 | - android:layout_width="match_parent" | ||
| 16 | - android:layout_height="?attr/actionBarSize" | ||
| 17 | - android:background="?attr/colorPrimary" | ||
| 18 | - app:popupTheme="@style/AppTheme.PopupOverlay"/> | ||
| 19 | - | ||
| 20 | - </android.support.design.widget.AppBarLayout> | ||
| 21 | - | ||
| 22 | - <include layout="@layout/content_main"/> | ||
| 23 | - | ||
| 24 | - <android.support.design.widget.FloatingActionButton | ||
| 25 | - android:id="@+id/fab" | ||
| 26 | - android:layout_width="wrap_content" | ||
| 27 | - android:layout_height="wrap_content" | ||
| 28 | - android:layout_gravity="bottom|end" | ||
| 29 | - android:layout_margin="@dimen/fab_margin" | ||
| 30 | - app:srcCompat="@android:drawable/ic_dialog_email"/> | ||
| 31 | - | ||
| 32 | -</android.support.design.widget.CoordinatorLayout> |
Please
register
or
login
to post a comment