Changeset 4


Ignore:
Timestamp:
05/03/12 22:18:02 (13 years ago)
Author:
remons
Message:

Added custom button
Added "drawable" folder
Added Menu

Location:
trunk/TagTracker
Files:
18 added
17 edited

Legend:

Unmodified
Added
Removed
  • trunk/TagTracker/AndroidManifest.xml

    r3 r4  
    1111        <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    1212    <application
    13         android:icon="@drawable/ic_launcher"
     13        android:icon="@drawable/tag_accept"
    1414        android:label="@string/app_name"
    1515        android:theme="@style/MyTheme">
  • trunk/TagTracker/gen/nl/deadpixel/tagtracker/beta/R.java

    r3 r4  
    1313    public static final class drawable {
    1414        public static final int ic_launcher=0x7f020000;
     15        public static final int tag_accept=0x7f020001;
     16        public static final int tb_offstate=0x7f020002;
     17        public static final int tb_onstate=0x7f020003;
     18        public static final int toggle_button=0x7f020004;
    1519    }
    1620    public static final class id {
    17         public static final int Screen=0x7f070000;
    18         public static final int status=0x7f070003;
    19         public static final int text=0x7f070001;
    20         public static final int zend=0x7f070002;
     21        public static final int Screen=0x7f080000;
     22        public static final int add_note=0x7f080005;
     23        public static final int add_uid=0x7f080004;
     24        public static final int status=0x7f080002;
     25        public static final int stopsend=0x7f080006;
     26        public static final int text=0x7f080001;
     27        public static final int zend=0x7f080003;
    2128    }
    2229    public static final class layout {
    2330        public static final int main=0x7f030000;
     31    }
     32    public static final class menu {
     33        public static final int lo_menu=0x7f070000;
    2434    }
    2535    public static final class string {
     
    2838    }
    2939    public static final class style {
     40        public static final int ActionBar=0x7f060001;
     41        public static final int ActionBar_Light=0x7f060003;
    3042        /**  Any customizations for your app running on pre-3.0 devices here
    31  Any customizations for your app running on post-3.0 devices here
    3243         */
    3344        public static final int MyTheme=0x7f060000;
     45        public static final int ToggleButton=0x7f060002;
    3446    }
    3547    public static final class xml {
  • trunk/TagTracker/res/layout/main.xml

    r3 r4  
    11<?xml version="1.0" encoding="utf-8"?>
    2 <RelativeLayout
    3     xmlns:android="http://schemas.android.com/apk/res/android"
     2<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
     3    android:id="@+id/Screen"
    44    android:layout_width="fill_parent"
    5     android:layout_height="fill_parent"
    6     android:id="@+id/Screen" >
    7                  <TextView
    8             android:id="@+id/text"
    9             android:layout_width="fill_parent"
    10             android:layout_height="wrap_content"
    11             android:layout_above="@+id/zend"
    12             android:layout_alignParentLeft="true"
    13             android:layout_alignParentTop="true" />
    14                  
    15                  <Button
    16             android:id="@+id/zend"
    17             android:layout_width="match_parent"
    18             android:layout_height="wrap_content"
    19             android:layout_above="@+id/status"
    20             android:layout_alignParentLeft="true"
    21             android:text="Verzenden" />
    22                  
    23         <ToggleButton
    24             android:id="@+id/status"
    25             android:layout_width="match_parent"
    26             android:layout_height="wrap_content"
    27             android:layout_alignParentBottom="true"
    28             android:layout_alignParentLeft="true"
    29             android:onClick="onToggleClicked"
    30             android:text="ToggleButton"
    31             android:textOff="Start"
    32             android:textOn="Stop" />
    33     </RelativeLayout>
     5    android:layout_height="fill_parent" >
     6
     7    <TextView
     8        android:id="@+id/text"
     9        android:layout_width="fill_parent"
     10        android:layout_height="wrap_content"
     11        android:layout_alignParentLeft="true"
     12        android:layout_alignParentTop="true" />
     13
     14
     15
     16    <ToggleButton
     17        android:id="@+id/status"
     18        style="@style/ToggleButton"
     19        android:layout_width="match_parent"
     20        android:layout_height="200dp"
     21        android:layout_marginLeft="20dp"
     22        android:layout_marginRight="20dp"
     23        android:layout_alignParentLeft="true"
     24        android:layout_centerVertical="true"
     25        android:onClick="onToggleClicked"
     26        android:textOff="START"
     27        android:textOn="STOP" />
     28
     29    <Button
     30        android:id="@+id/zend"
     31        android:layout_width="match_parent"
     32        android:layout_height="wrap_content"
     33        android:layout_alignParentBottom="true"
     34        android:layout_alignParentLeft="true"
     35        android:text="Verzenden" />
     36
     37</RelativeLayout>
  • trunk/TagTracker/res/values-v11/themes.xml

    r3 r4  
    11<?xml version="1.0" encoding="utf-8"?>
    22<resources>
    3     <style name="MyTheme" parent="@android:style/Theme.Holo">
     3     <style name="ActionBar" parent="@android:style/Widget.Holo.ActionBar" />
     4    <style name="MyTheme" parent="@android:style/Theme.Holo.Light">
    45        <!-- Any customizations for your app running on post-3.0 devices here -->
     6        <item name="android:actionBarStyle">@style/ActionBar.Light</item>
     7    </style>
     8    <style name="ToggleButton" parent="@android:Widget">
     9        <item name="android:background">@drawable/toggle_button</item>
     10        <item name="android:textColor">#FF231f20</item>
     11        <item name="android:textSize">50dp</item>
     12    </style>
     13    <style name="ActionBar.Light" parent="@style/ActionBar">
     14        <item name="android:background">#FF03a9e7</item>
     15        <item name="android:windowActionBarOverlay">true</item>
    516    </style>
    617</resources>
  • trunk/TagTracker/src/nl/deadpixel/tagtracker/beta/TagTrackerActivity.java

    r3 r4  
    2424import android.os.PowerManager.WakeLock;
    2525import android.util.Log;
     26import android.view.Menu;
     27import android.view.MenuInflater;
    2628import android.view.View;
    2729import android.widget.Button;
     
    3537    private IntentFilter[] mFilters;
    3638    private String[][] mTechLists;
    37     private TextView mText;
    38     private int mCount = 0;
    3939    private FileHandler fh = new FileHandler();
    4040    private boolean writeAllow = false;
     
    5555        });
    5656        mScreen = (RelativeLayout) findViewById(R.id.Screen);
    57         mText = (TextView) findViewById(R.id.text);
    58         mText.setText("Scan a tag");
    5957        mWakeLock = pm.newWakeLock(PowerManager.SCREEN_DIM_WAKE_LOCK | PowerManager.ON_AFTER_RELEASE,"");   
    6058        mWakeLock.acquire();
     
    9694            fh.writeEnd(DateFormat.getDateTimeInstance().format(new Date()));
    9795            writeAllow = false;
    98             mText = (TextView) findViewById(R.id.text);
    99             mText.setText("Scan a tag");
    10096            cardID.clear();
    10197        }
     
    120116                                if(!cardID.contains(uid))
    121117                                {
    122                                         //Log.i("Foreground dispatch", "Discovered tag with ID: " + uid);
     118                                        Log.i("Foreground dispatch", "Discovered tag with ID: " + uid);
    123119                                    //mText.append("\r\n["+time+"] Discovered tag " + ++mCount + " with ID: " + uid);
    124120                                    fh.writeUID(uid, time, "");
     
    172168        handler.postDelayed(new Runnable() {
    173169             public void run() {
    174                 mScreen.setBackgroundColor(android.R.color.black);
     170                mScreen.setBackgroundColor(android.R.color.white);
    175171             }
    176172        }, time);
     
    183179        if (mAdapter != null) mAdapter.disableForegroundDispatch(this);
    184180    }
     181    @Override
     182    public boolean onCreateOptionsMenu(Menu menu) {
     183        MenuInflater inflater = getMenuInflater();
     184        inflater.inflate(R.menu.lo_menu, menu);
     185        return true;
     186    }
    185187}
Note: See TracChangeset for help on using the changeset viewer.