wear cleanup

This commit is contained in:
AdrianLxM 2017-02-09 16:29:46 +01:00
parent b8c3fe2933
commit 4dcbbd3df2
7 changed files with 0 additions and 209 deletions

View file

@ -112,23 +112,6 @@
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".actions.bolus.BolusActivity"
android:label="@string/title_activity_bolus">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".actions.bolus.GridActivity"
android:label="GridTest">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".actions.wizard.WizardActivity"
android:label="Wizard">

View file

@ -5,8 +5,6 @@ import android.content.Intent;
import info.nightscout.androidaps.ListenerService;
import info.nightscout.androidaps.NWPreferences;
import info.nightscout.androidaps.actions.bolus.BolusActivity;
import info.nightscout.androidaps.actions.bolus.GridActivity;
import info.nightscout.androidaps.actions.wizard.WizardActivity;
/**
@ -55,9 +53,6 @@ final class ActionsDefinitions {
ListenerService.initiateAction(ctx, "fillpreset 3");
break;
case 7:
intent = new Intent(ctx, GridActivity.class);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
ctx.startActivity(intent);
break;
}

View file

@ -1,26 +0,0 @@
package info.nightscout.androidaps.actions.bolus;
import android.app.Activity;
import android.os.Bundle;
import android.support.wearable.view.WatchViewStub;
import android.widget.TextView;
import info.nightscout.androidaps.R;
public class BolusActivity extends Activity {
private TextView mTextView;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_bolus);
final WatchViewStub stub = (WatchViewStub) findViewById(R.id.watch_view_stub);
stub.setOnLayoutInflatedListener(new WatchViewStub.OnLayoutInflatedListener() {
@Override
public void onLayoutInflated(WatchViewStub stub) {
//bmTextView = (TextView) stub.findViewById(R.id.text);
}
});
}
}

View file

@ -1,80 +0,0 @@
package info.nightscout.androidaps.actions.bolus;
import android.app.Activity;
import android.content.res.Resources;
import android.os.Bundle;
import android.support.wearable.view.DotsPageIndicator;
import android.support.wearable.view.GridPagerAdapter;
import android.support.wearable.view.GridViewPager;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import info.nightscout.androidaps.R;
/**
* Created by adrian on 09/02/17.
*/
public class GridActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.grid_layout);
final Resources res = getResources();
final GridViewPager pager = (GridViewPager) findViewById(R.id.pager);
pager.setAdapter(new MyGridViewPagerAdapter());
DotsPageIndicator dotsPageIndicator = (DotsPageIndicator) findViewById(R.id.page_indicator);
dotsPageIndicator.setPager(pager);
}
@Override
protected void onPause() {
super.onPause();
finish();
}
private class MyGridViewPagerAdapter extends GridPagerAdapter {
@Override
public int getColumnCount(int arg0) {
return 3;
}
@Override
public int getRowCount() {
return 1;
}
@Override
public Object instantiateItem(ViewGroup container, int row, int col) {
final View view = LayoutInflater.from(getApplicationContext()).inflate(R.layout.action_editplusminus_item, container, false);
final TextView textView = (TextView) view.findViewById(R.id.label);
textView.setText("label: " + col);
container.addView(view);
return view;
}
@Override
public void destroyItem(ViewGroup container, int row, int col, Object view) {
container.removeView((View)view);
}
@Override
public boolean isViewFromObject(View view, Object object) {
return view==object;
}
}
}

View file

@ -1,11 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.wearable.view.WatchViewStub xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/watch_view_stub"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:rectLayout="@layout/rect_activity_bolus"
app:roundLayout="@layout/round_activity_bolus"
tools:context="info.nightscout.androidaps.actions.bolus.BolusActivity"
tools:deviceIds="wear"></android.support.wearable.view.WatchViewStub>

View file

@ -1,54 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center_vertical|center_horizontal"
android:layout_alignParentTop="true"
android:layout_alignParentStart="true">
<ImageView
android:id="@+id/treatments_newtreatment_insulinamount_minus"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:background="@drawable/circle"
android:backgroundTint="#ffffff"
android:src="@drawable/ic_action_minus"
android:tint="#ffffff" />
<EditText
android:id="@+id/treatments_newtreatment_insulinamount"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:inputType="numberDecimal"
android:minWidth="50dp"
android:padding="10dp"
android:text="112"
android:cursorVisible="false"
android:textAppearance="?android:attr/textAppearanceLarge"
android:gravity="center_horizontal" />
<TextView
android:id="@+id/label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:text="label"
android:textAppearance="?android:attr/textAppearanceMedium"
android:gravity="center_horizontal" />
<ImageView
android:id="@+id/treatments_newtreatment_insulinamount_plus"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:background="@drawable/circle"
android:backgroundTint="#ffffff"
android:src="@drawable/ic_action_add"
android:tint="#ffffff" />
</LinearLayout>
</RelativeLayout>

View file

@ -1,16 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="info.nightscout.androidaps.actions.bolus.BolusActivity"
tools:deviceIds="wear_round">
<TextView
android:id="@+id/text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:text="@string/hello_round" />
</RelativeLayout>