Commit 4ffb6d5d authored by Bruno Agrizzi's avatar Bruno Agrizzi

Log in Hexa implemented 📶

parent 30f2d948
BluetoothChat BluetoothEvologica
\ No newline at end of file \ No newline at end of file
...@@ -43,4 +43,20 @@ ...@@ -43,4 +43,20 @@
<component name="ProjectType"> <component name="ProjectType">
<option name="id" value="Android" /> <option name="id" value="Android" />
</component> </component>
<component name="masterDetails">
<states>
<state key="ProjectJDKs.UI">
<settings>
<last-edited>1.8</last-edited>
<splitter-proportions>
<option name="proportions">
<list>
<option value="0.2" />
</list>
</option>
</splitter-proportions>
</settings>
</state>
</states>
</component>
</project> </project>
\ No newline at end of file
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<component name="ProjectModuleManager"> <component name="ProjectModuleManager">
<modules> <modules>
<module fileurl="file://$PROJECT_DIR$/Application/Application.iml" filepath="$PROJECT_DIR$/Application/Application.iml" /> <module fileurl="file://$PROJECT_DIR$/Application/Application.iml" filepath="$PROJECT_DIR$/Application/Application.iml" />
<module fileurl="file://$PROJECT_DIR$/BluetoothChat.iml" filepath="$PROJECT_DIR$/BluetoothChat.iml" /> <module fileurl="file://$PROJECT_DIR$/BluetoothEvologica.iml" filepath="$PROJECT_DIR$/BluetoothEvologica.iml" />
</modules> </modules>
</component> </component>
</project> </project>
\ No newline at end of file
...@@ -277,31 +277,36 @@ containing a value of this type. ...@@ -277,31 +277,36 @@ containing a value of this type.
public static final int alignMargins=0x7f090003; public static final int alignMargins=0x7f090003;
public static final int bottom=0x7f090004; public static final int bottom=0x7f090004;
public static final int button_scan=0x7f090016; public static final int button_scan=0x7f090016;
public static final int button_send=0x7f09001b; public static final int button_send=0x7f09001d;
public static final int center=0x7f090005; public static final int center=0x7f090005;
public static final int center_horizontal=0x7f090006; public static final int center_horizontal=0x7f090006;
public static final int center_vertical=0x7f090007; public static final int center_vertical=0x7f090007;
public static final int clip_horizontal=0x7f090008; public static final int clip_horizontal=0x7f090008;
public static final int clip_vertical=0x7f090009; public static final int clip_vertical=0x7f090009;
public static final int edit_text_out=0x7f09001a; public static final int edit_text_out=0x7f09001c;
public static final int end=0x7f09000a; public static final int end=0x7f09000a;
public static final int fill=0x7f09000b; public static final int fill=0x7f09000b;
public static final int fill_horizontal=0x7f09000c; public static final int fill_horizontal=0x7f09000c;
public static final int fill_vertical=0x7f09000d; public static final int fill_vertical=0x7f09000d;
public static final int horizontal=0x7f090000; public static final int horizontal=0x7f090000;
public static final int in=0x7f090019; public static final int in=0x7f09001b;
public static final int left=0x7f09000e; public static final int left=0x7f09000e;
public static final int menu_toggle_log=0x7f09001d; public static final int log_fragment=0x7f090019;
public static final int menu_toggle_log=0x7f090022;
public static final int new_devices=0x7f090015; public static final int new_devices=0x7f090015;
public static final int paired_devices=0x7f090013; public static final int paired_devices=0x7f090013;
public static final int right=0x7f09000f; public static final int right=0x7f09000f;
public static final int sample_content_fragment=0x7f090018; public static final int sample_content_fragment=0x7f09001a;
public static final int sample_main_layout=0x7f090017; public static final int sample_main_layout=0x7f090017;
public static final int secure_connect_scan=0x7f09001c; public static final int sample_output=0x7f090018;
public static final int secure_connect_scan=0x7f090021;
public static final int start=0x7f090010; public static final int start=0x7f090010;
public static final int title_new_devices=0x7f090014; public static final int title_new_devices=0x7f090014;
public static final int title_paired_devices=0x7f090012; public static final int title_paired_devices=0x7f090012;
public static final int top=0x7f090011; public static final int top=0x7f090011;
public static final int txtDate=0x7f09001f;
public static final int txtMessage=0x7f090020;
public static final int txtSender=0x7f09001e;
public static final int vertical=0x7f090001; public static final int vertical=0x7f090001;
} }
public static final class layout { public static final class layout {
...@@ -310,6 +315,8 @@ containing a value of this type. ...@@ -310,6 +315,8 @@ containing a value of this type.
public static final int device_name=0x7f030002; public static final int device_name=0x7f030002;
public static final int fragment_bluetooth_chat=0x7f030003; public static final int fragment_bluetooth_chat=0x7f030003;
public static final int message=0x7f030004; public static final int message=0x7f030004;
public static final int message_left=0x7f030005;
public static final int message_right=0x7f030006;
} }
public static final class menu { public static final class menu {
public static final int bluetooth_chat=0x7f080000; public static final int bluetooth_chat=0x7f080000;
......
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<merger version="3"><dataSet config="main"><source path="C:\Users\brunoagrizzi\Documents\Android\BluetoothChat\Application\tests\assets"/></dataSet></merger> <merger version="3"><dataSet config="main"><source path="C:\Users\brunoagrizzi\Documents\Android\BluetoothEvologica\Application\tests\assets"/></dataSet></merger>
\ No newline at end of file \ No newline at end of file
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<merger version="3"><dataSet config="23.0.0"><source path="C:\Users\brunoagrizzi\Documents\Android\BluetoothChat\Application\build\intermediates\exploded-aar\com.android.support\cardview-v7\23.0.0\assets"/></dataSet><dataSet config="23.0.0"><source path="C:\Users\brunoagrizzi\Documents\Android\BluetoothChat\Application\build\intermediates\exploded-aar\com.android.support\support-v4\23.0.0\assets"/></dataSet><dataSet config="23.0.0"><source path="C:\Users\brunoagrizzi\Documents\Android\BluetoothChat\Application\build\intermediates\exploded-aar\com.android.support\gridlayout-v7\23.0.0\assets"/></dataSet><dataSet config="main"><source path="C:\Users\brunoagrizzi\Documents\Android\BluetoothChat\Application\src\main\assets"/></dataSet><dataSet config="debug"><source path="C:\Users\brunoagrizzi\Documents\Android\BluetoothChat\Application\src\debug\assets"/></dataSet></merger> <merger version="3"><dataSet config="23.0.0"><source path="C:\Users\brunoagrizzi\Documents\Android\BluetoothEvologica\Application\build\intermediates\exploded-aar\com.android.support\cardview-v7\23.0.0\assets"/></dataSet><dataSet config="23.0.0"><source path="C:\Users\brunoagrizzi\Documents\Android\BluetoothEvologica\Application\build\intermediates\exploded-aar\com.android.support\support-v4\23.0.0\assets"/></dataSet><dataSet config="23.0.0"><source path="C:\Users\brunoagrizzi\Documents\Android\BluetoothEvologica\Application\build\intermediates\exploded-aar\com.android.support\gridlayout-v7\23.0.0\assets"/></dataSet><dataSet config="main"><source path="C:\Users\brunoagrizzi\Documents\Android\BluetoothEvologica\Application\src\main\assets"/></dataSet><dataSet config="debug"><source path="C:\Users\brunoagrizzi\Documents\Android\BluetoothEvologica\Application\src\debug\assets"/></dataSet></merger>
\ No newline at end of file \ No newline at end of file
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<merger version="3"><dataSet config="main"><source path="C:\Users\brunoagrizzi\Documents\Android\BluetoothChat\Application\tests\res"/><source path="C:\Users\brunoagrizzi\Documents\Android\BluetoothChat\Application\build\generated\res\rs\androidTest\debug"/><source path="C:\Users\brunoagrizzi\Documents\Android\BluetoothChat\Application\build\generated\res\generated\androidTest\debug"/></dataSet><mergedItems/></merger> <merger version="3"><dataSet config="main"><source path="C:\Users\brunoagrizzi\Documents\Android\BluetoothEvologica\Application\tests\res"/><source path="C:\Users\brunoagrizzi\Documents\Android\BluetoothEvologica\Application\build\generated\res\rs\androidTest\debug"/><source path="C:\Users\brunoagrizzi\Documents\Android\BluetoothEvologica\Application\build\generated\res\generated\androidTest\debug"/></dataSet><mergedItems/></merger>
\ No newline at end of file \ No newline at end of file
...@@ -72,4 +72,4 @@ ...@@ -72,4 +72,4 @@
</LinearLayout> </LinearLayout>
<!-- From: file:/C:/Users/brunoagrizzi/Documents/Android/BluetoothChat/Application/src/main/res/layout-w720dp/activity_main.xml --> <!-- From: file:/C:/Users/brunoagrizzi/Documents/Android/BluetoothEvologica/Application/src/main/res/layout-w720dp/activity_main.xml -->
\ No newline at end of file \ No newline at end of file
...@@ -64,4 +64,4 @@ ...@@ -64,4 +64,4 @@
android:text="@string/button_scan" android:text="@string/button_scan"
/> />
</LinearLayout> </LinearLayout>
<!-- From: file:/C:/Users/brunoagrizzi/Documents/Android/BluetoothChat/Application/src/main/res/layout/activity_device_list.xml --> <!-- From: file:/C:/Users/brunoagrizzi/Documents/Android/BluetoothEvologica/Application/src/main/res/layout/activity_device_list.xml -->
\ No newline at end of file \ No newline at end of file
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
android:layout_height="match_parent" android:layout_height="match_parent"
android:id="@+id/sample_main_layout"> android:id="@+id/sample_main_layout">
<!--<ViewAnimator <ViewAnimator
android:id="@+id/sample_output" android:id="@+id/sample_output"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="0px" android:layout_height="0px"
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
android:paddingRight="@dimen/horizontal_page_margin" android:paddingRight="@dimen/horizontal_page_margin"
android:paddingTop="@dimen/vertical_page_margin" android:paddingTop="@dimen/vertical_page_margin"
android:paddingBottom="@dimen/vertical_page_margin" android:paddingBottom="@dimen/vertical_page_margin"
android:text="@string/intro_message" /> android:text="" />
</ScrollView> </ScrollView>
<fragment <fragment
...@@ -48,7 +48,7 @@ ...@@ -48,7 +48,7 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" /> android:layout_height="match_parent" />
</ViewAnimator>--> </ViewAnimator>
<View <View
android:layout_width="match_parent" android:layout_width="match_parent"
...@@ -63,4 +63,4 @@ ...@@ -63,4 +63,4 @@
</LinearLayout> </LinearLayout>
<!-- From: file:/C:/Users/brunoagrizzi/Documents/Android/BluetoothChat/Application/src/main/res/layout/activity_main.xml --> <!-- From: file:/C:/Users/brunoagrizzi/Documents/Android/BluetoothEvologica/Application/src/main/res/layout/activity_main.xml -->
\ No newline at end of file \ No newline at end of file
...@@ -19,4 +19,4 @@ ...@@ -19,4 +19,4 @@
android:padding="5dp" android:padding="5dp"
android:textSize="18sp" android:textSize="18sp"
/> />
<!-- From: file:/C:/Users/brunoagrizzi/Documents/Android/BluetoothChat/Application/src/main/res/layout/device_name.xml --> <!-- From: file:/C:/Users/brunoagrizzi/Documents/Android/BluetoothEvologica/Application/src/main/res/layout/device_name.xml -->
\ No newline at end of file \ No newline at end of file
...@@ -15,9 +15,10 @@ ...@@ -15,9 +15,10 @@
limitations under the License. limitations under the License.
--> -->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:orientation="vertical" > xmlns:tools="http://schemas.android.com/tools"
android:orientation="vertical">
<ListView <ListView
android:id="@+id/in" android:id="@+id/in"
...@@ -25,7 +26,8 @@ ...@@ -25,7 +26,8 @@
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_weight="1" android:layout_weight="1"
android:stackFromBottom="true" android:stackFromBottom="true"
android:transcriptMode="alwaysScroll" /> android:transcriptMode="alwaysScroll"
tools:listitem="@layout/message_right"/>
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
...@@ -47,4 +49,4 @@ ...@@ -47,4 +49,4 @@
</LinearLayout> </LinearLayout>
</LinearLayout> </LinearLayout>
<!-- From: file:/C:/Users/brunoagrizzi/Documents/Android/BluetoothChat/Application/src/main/res/layout/fragment_bluetooth_chat.xml --> <!-- From: file:/C:/Users/brunoagrizzi/Documents/Android/BluetoothEvologica/Application/src/main/res/layout/fragment_bluetooth_chat.xml -->
\ No newline at end of file \ No newline at end of file
...@@ -19,4 +19,4 @@ ...@@ -19,4 +19,4 @@
android:padding="5dp" android:padding="5dp"
android:textSize="18sp" android:textSize="18sp"
/> />
<!-- From: file:/C:/Users/brunoagrizzi/Documents/Android/BluetoothChat/Application/src/main/res/layout/message.xml --> <!-- From: file:/C:/Users/brunoagrizzi/Documents/Android/BluetoothEvologica/Application/src/main/res/layout/message.xml -->
\ No newline at end of file \ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="10dp">
<RelativeLayout android:layout_width="fill_parent" android:layout_height="fill_parent"
android:layout_marginRight="10dp">
<TextView
android:id="@+id/txtSender"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:text=""
android:textSize="16sp"
android:singleLine="true"
android:layout_alignParentLeft="true"
android:paddingLeft="10dp"
android:paddingBottom="6dp"
android:textColor="@android:color/black" android:textStyle="bold"/>
<TextView
android:id="@+id/txtDate"
android:layout_alignParentRight="true"
android:textColor="@android:color/holo_purple"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingRight="2dp"
android:paddingBottom="6dp"
android:textSize="12sp"
android:text=""
android:layout_alignBottom="@+id/txtSender"/>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/txtSender"
android:layout_alignParentLeft="true"
android:padding="12dp"
android:background="@android:color/darker_gray"
>
<TextView
android:id="@+id/txtMessage"
android:paddingLeft="12dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@android:color/black"
android:textSize="14sp"
android:text="Hello"
/>
</RelativeLayout>
</RelativeLayout>
</RelativeLayout><!-- From: file:/C:/Users/brunoagrizzi/Documents/Android/BluetoothEvologica/Application/src/main/res/layout/message_left.xml -->
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="10dp">
<RelativeLayout android:layout_width="fill_parent" android:layout_height="fill_parent"
android:layout_marginLeft="10dp">
<TextView
android:id="@+id/txtSender"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:text=""
android:textSize="16sp"
android:singleLine="true"
android:layout_alignParentRight="true"
android:paddingRight="10dp"
android:paddingBottom="6dp"
android:textColor="@android:color/black" android:textStyle="bold"/>
<TextView
android:id="@+id/txtDate"
android:layout_alignParentLeft="true"
android:textColor="@android:color/holo_purple"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="2dp"
android:paddingBottom="6dp"
android:textSize="12sp"
android:text=""
android:layout_alignBottom="@+id/txtSender"
/>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/txtSender"
android:layout_alignParentRight="true"
android:padding="12dp"
android:background="@android:color/holo_purple"
>
<TextView
android:id="@+id/txtMessage"
android:paddingRight="12dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:textColor="@android:color/white"
android:textSize="14sp"
android:text="Hello, how are you?"
/>
</RelativeLayout>
</RelativeLayout>
</RelativeLayout><!-- From: file:/C:/Users/brunoagrizzi/Documents/Android/BluetoothEvologica/Application/src/main/res/layout/message_right.xml -->
\ No newline at end of file
...@@ -32,4 +32,4 @@ ...@@ -32,4 +32,4 @@
android:title="@string/discoverable"/>--> android:title="@string/discoverable"/>-->
</menu> </menu>
<!-- From: file:/C:/Users/brunoagrizzi/Documents/Android/BluetoothChat/Application/src/main/res/menu/bluetooth_chat.xml --> <!-- From: file:/C:/Users/brunoagrizzi/Documents/Android/BluetoothEvologica/Application/src/main/res/menu/bluetooth_chat.xml -->
\ No newline at end of file \ No newline at end of file
...@@ -17,6 +17,6 @@ ...@@ -17,6 +17,6 @@
<menu xmlns:android="http://schemas.android.com/apk/res/android"> <menu xmlns:android="http://schemas.android.com/apk/res/android">
<item android:id="@+id/menu_toggle_log" <item android:id="@+id/menu_toggle_log"
android:showAsAction="always" android:showAsAction="always"
android:title="" /> android:title="Show log" />
</menu> </menu>
<!-- From: file:/C:/Users/brunoagrizzi/Documents/Android/BluetoothChat/Application/src/main/res/menu/main.xml --> <!-- From: file:/C:/Users/brunoagrizzi/Documents/Android/BluetoothEvologica/Application/src/main/res/menu/main.xml -->
\ No newline at end of file \ No newline at end of file
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<resources> <resources>
<!-- From: file:/C:/Users/brunoagrizzi/Documents/Android/BluetoothChat/Application/src/main/res/values-sw600dp/template-dimens.xml --> <!-- From: file:/C:/Users/brunoagrizzi/Documents/Android/BluetoothEvologica/Application/src/main/res/values-sw600dp/template-dimens.xml -->
<eat-comment/> <eat-comment/>
<dimen name="horizontal_page_margin">@dimen/margin_huge</dimen> <dimen name="horizontal_page_margin">@dimen/margin_huge</dimen>
<dimen name="vertical_page_margin">@dimen/margin_medium</dimen> <dimen name="vertical_page_margin">@dimen/margin_medium</dimen>
<!-- From: file:/C:/Users/brunoagrizzi/Documents/Android/BluetoothChat/Application/src/main/res/values-sw600dp/template-styles.xml --> <!-- From: file:/C:/Users/brunoagrizzi/Documents/Android/BluetoothEvologica/Application/src/main/res/values-sw600dp/template-styles.xml -->
<eat-comment/> <eat-comment/>
<style name="Widget.SampleMessage"> <style name="Widget.SampleMessage">
<item name="android:textAppearance">?android:textAppearanceLarge</item> <item name="android:textAppearance">?android:textAppearanceLarge</item>
......
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<resources> <resources>
<!-- From: file:/C:/Users/brunoagrizzi/Documents/Android/BluetoothChat/Application/src/main/res/values-v11/template-styles.xml --> <!-- From: file:/C:/Users/brunoagrizzi/Documents/Android/BluetoothEvologica/Application/src/main/res/values-v11/template-styles.xml -->
<eat-comment/> <eat-comment/>
<style name="Theme.Base" parent="android:Theme.Holo.Light"/> <style name="Theme.Base" parent="android:Theme.Holo.Light"/>
</resources> </resources>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<resources> <resources>
<!-- From: file:/C:/Users/brunoagrizzi/Documents/Android/BluetoothChat/Application/src/main/res/values-v21/base-template-styles.xml --> <!-- From: file:/C:/Users/brunoagrizzi/Documents/Android/BluetoothEvologica/Application/src/main/res/values-v21/base-template-styles.xml -->
<eat-comment/> <eat-comment/>
<style name="Theme.Base" parent="android:Theme.Material.Light"> <style name="Theme.Base" parent="android:Theme.Material.Light">
</style> </style>
......
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<resources xmlns:ns1="urn:oasis:names:tc:xliff:document:1.2"> <resources xmlns:ns1="urn:oasis:names:tc:xliff:document:1.2">
<!-- From: file:/C:/Users/brunoagrizzi/Documents/Android/BluetoothChat/Application/build/intermediates/exploded-aar/com.android.support/cardview-v7/23.0.0/res/values/values.xml --> <!-- From: file:/C:/Users/brunoagrizzi/Documents/Android/BluetoothEvologica/Application/build/intermediates/exploded-aar/com.android.support/cardview-v7/23.0.0/res/values/values.xml -->
<eat-comment/> <eat-comment/>
<color name="cardview_dark_background">#FF202020</color> <color name="cardview_dark_background">#FF202020</color>
<color name="cardview_light_background">#FFFAFAFA</color> <color name="cardview_light_background">#FFFAFAFA</color>
...@@ -12,10 +12,10 @@ ...@@ -12,10 +12,10 @@
<dimen name="cardview_compat_inset_shadow">1dp</dimen> <dimen name="cardview_compat_inset_shadow">1dp</dimen>
<dimen name="cardview_default_elevation">2dp</dimen> <dimen name="cardview_default_elevation">2dp</dimen>
<dimen name="cardview_default_radius">2dp</dimen> <dimen name="cardview_default_radius">2dp</dimen>
<!-- From: file:/C:/Users/brunoagrizzi/Documents/Android/BluetoothChat/Application/build/intermediates/exploded-aar/com.android.support/gridlayout-v7/23.0.0/res/values/values.xml --> <!-- From: file:/C:/Users/brunoagrizzi/Documents/Android/BluetoothEvologica/Application/build/intermediates/exploded-aar/com.android.support/gridlayout-v7/23.0.0/res/values/values.xml -->
<eat-comment/> <eat-comment/>
<dimen name="default_gap">8dip</dimen> <dimen name="default_gap">8dip</dimen>
<!-- From: file:/C:/Users/brunoagrizzi/Documents/Android/BluetoothChat/Application/src/main/res/values/template-dimens.xml --> <!-- From: file:/C:/Users/brunoagrizzi/Documents/Android/BluetoothEvologica/Application/src/main/res/values/template-dimens.xml -->
<eat-comment/> <eat-comment/>
<dimen name="horizontal_page_margin">@dimen/margin_medium</dimen> <dimen name="horizontal_page_margin">@dimen/margin_medium</dimen>
<dimen name="margin_huge">64dp</dimen> <dimen name="margin_huge">64dp</dimen>
...@@ -24,16 +24,16 @@ ...@@ -24,16 +24,16 @@
<dimen name="margin_small">8dp</dimen> <dimen name="margin_small">8dp</dimen>
<dimen name="margin_tiny">4dp</dimen> <dimen name="margin_tiny">4dp</dimen>
<dimen name="vertical_page_margin">@dimen/margin_medium</dimen> <dimen name="vertical_page_margin">@dimen/margin_medium</dimen>
<!-- From: file:/C:/Users/brunoagrizzi/Documents/Android/BluetoothChat/Application/src/main/res/values/base-strings.xml --> <!-- From: file:/C:/Users/brunoagrizzi/Documents/Android/BluetoothEvologica/Application/src/main/res/values/base-strings.xml -->
<eat-comment/> <eat-comment/>
<string name="app_name">BluetoothChat</string> <string name="app_name">BluetoothChat</string>
<!-- From: file:/C:/Users/brunoagrizzi/Documents/Android/BluetoothChat/Application/src/main/res/values/strings.xml --> <!-- From: file:/C:/Users/brunoagrizzi/Documents/Android/BluetoothEvologica/Application/src/main/res/values/strings.xml -->
<eat-comment/> <eat-comment/>
<string name="bt_not_enabled_leaving">Bluetooth was not enabled. Leaving Bluetooth Chat.</string> <string name="bt_not_enabled_leaving">Bluetooth was not enabled. Leaving Bluetooth Chat.</string>
<string name="button_scan">Scan for devices</string> <string name="button_scan">Scan for devices</string>
<string name="discoverable">Make discoverable</string> <string name="discoverable">Make discoverable</string>
<string name="insecure_connect">Connect a device - Insecure</string> <string name="insecure_connect">Connect a device - Insecure</string>
<!-- From: file:/C:/Users/brunoagrizzi/Documents/Android/BluetoothChat/Application/src/main/res/values/base-strings.xml --> <!-- From: file:/C:/Users/brunoagrizzi/Documents/Android/BluetoothEvologica/Application/src/main/res/values/base-strings.xml -->
<eat-comment/> <eat-comment/>
<string name="intro_message"> <string name="intro_message">
<![CDATA[ <![CDATA[
...@@ -50,16 +50,16 @@ ...@@ -50,16 +50,16 @@
]]> ]]>
</string> </string>
<!-- From: file:/C:/Users/brunoagrizzi/Documents/Android/BluetoothChat/Application/src/main/res/values/strings.xml --> <!-- From: file:/C:/Users/brunoagrizzi/Documents/Android/BluetoothEvologica/Application/src/main/res/values/strings.xml -->
<eat-comment/> <eat-comment/>
<string name="none_found">No devices found</string> <string name="none_found">No devices found</string>
<string name="none_paired">No devices have been paired</string> <string name="none_paired">No devices have been paired</string>
<string name="not_connected">You are not connected to a device</string> <string name="not_connected">You are not connected to a device</string>
<!-- From: file:/C:/Users/brunoagrizzi/Documents/Android/BluetoothChat/Application/src/main/res/values/fragmentview_strings.xml --> <!-- From: file:/C:/Users/brunoagrizzi/Documents/Android/BluetoothEvologica/Application/src/main/res/values/fragmentview_strings.xml -->
<eat-comment/> <eat-comment/>
<string name="sample_hide_log">Hide Log</string> <string name="sample_hide_log">Hide Log</string>
<string name="sample_show_log">Show Log</string> <string name="sample_show_log">Show Log</string>
<!-- From: file:/C:/Users/brunoagrizzi/Documents/Android/BluetoothChat/Application/src/main/res/values/strings.xml --> <!-- From: file:/C:/Users/brunoagrizzi/Documents/Android/BluetoothEvologica/Application/src/main/res/values/strings.xml -->
<eat-comment/> <eat-comment/>
<string name="scanning">scanning for devices...</string> <string name="scanning">scanning for devices...</string>
<string name="secure_connect">Connect a device - Secure</string> <string name="secure_connect">Connect a device - Secure</string>
...@@ -70,10 +70,10 @@ ...@@ -70,10 +70,10 @@
<string name="title_not_connected">not connected</string> <string name="title_not_connected">not connected</string>
<string name="title_other_devices">Other Available Devices</string> <string name="title_other_devices">Other Available Devices</string>
<string name="title_paired_devices">Paired Devices</string> <string name="title_paired_devices">Paired Devices</string>
<!-- From: file:/C:/Users/brunoagrizzi/Documents/Android/BluetoothChat/Application/src/main/res/values/template-styles.xml --> <!-- From: file:/C:/Users/brunoagrizzi/Documents/Android/BluetoothEvologica/Application/src/main/res/values/template-styles.xml -->
<eat-comment/> <eat-comment/>
<style name="AppTheme" parent="Theme.Sample"/> <style name="AppTheme" parent="Theme.Sample"/>
<!-- From: file:/C:/Users/brunoagrizzi/Documents/Android/BluetoothChat/Application/build/intermediates/exploded-aar/com.android.support/cardview-v7/23.0.0/res/values/values.xml --> <!-- From: file:/C:/Users/brunoagrizzi/Documents/Android/BluetoothEvologica/Application/build/intermediates/exploded-aar/com.android.support/cardview-v7/23.0.0/res/values/values.xml -->
<eat-comment/> <eat-comment/>
<style name="CardView"> <style name="CardView">
<item name="cardBackgroundColor">@color/cardview_light_background</item> <item name="cardBackgroundColor">@color/cardview_light_background</item>
...@@ -89,7 +89,7 @@ ...@@ -89,7 +89,7 @@
<style name="CardView.Light"> <style name="CardView.Light">
<item name="cardBackgroundColor">@color/cardview_light_background</item> <item name="cardBackgroundColor">@color/cardview_light_background</item>
</style> </style>
<!-- From: file:/C:/Users/brunoagrizzi/Documents/Android/BluetoothChat/Application/src/main/res/values/template-styles.xml --> <!-- From: file:/C:/Users/brunoagrizzi/Documents/Android/BluetoothEvologica/Application/src/main/res/values/template-styles.xml -->
<eat-comment/> <eat-comment/>
<style name="Theme.Base" parent="android:Theme.Light"/> <style name="Theme.Base" parent="android:Theme.Light"/>
<style name="Theme.Sample" parent="Theme.Base"/> <style name="Theme.Sample" parent="Theme.Base"/>
......
...@@ -45,37 +45,44 @@ int id alignBounds 0x7f090002 ...@@ -45,37 +45,44 @@ int id alignBounds 0x7f090002
int id alignMargins 0x7f090003 int id alignMargins 0x7f090003
int id bottom 0x7f090004 int id bottom 0x7f090004
int id button_scan 0x7f090016 int id button_scan 0x7f090016
int id button_send 0x7f09001b int id button_send 0x7f09001d
int id center 0x7f090005 int id center 0x7f090005
int id center_horizontal 0x7f090006 int id center_horizontal 0x7f090006
int id center_vertical 0x7f090007 int id center_vertical 0x7f090007
int id clip_horizontal 0x7f090008 int id clip_horizontal 0x7f090008
int id clip_vertical 0x7f090009 int id clip_vertical 0x7f090009
int id edit_text_out 0x7f09001a int id edit_text_out 0x7f09001c
int id end 0x7f09000a int id end 0x7f09000a
int id fill 0x7f09000b int id fill 0x7f09000b
int id fill_horizontal 0x7f09000c int id fill_horizontal 0x7f09000c
int id fill_vertical 0x7f09000d int id fill_vertical 0x7f09000d
int id horizontal 0x7f090000 int id horizontal 0x7f090000
int id in 0x7f090019 int id in 0x7f09001b
int id left 0x7f09000e int id left 0x7f09000e
int id menu_toggle_log 0x7f09001d int id log_fragment 0x7f090019
int id menu_toggle_log 0x7f090022
int id new_devices 0x7f090015 int id new_devices 0x7f090015
int id paired_devices 0x7f090013 int id paired_devices 0x7f090013
int id right 0x7f09000f int id right 0x7f09000f
int id sample_content_fragment 0x7f090018 int id sample_content_fragment 0x7f09001a
int id sample_main_layout 0x7f090017 int id sample_main_layout 0x7f090017
int id secure_connect_scan 0x7f09001c int id sample_output 0x7f090018
int id secure_connect_scan 0x7f090021
int id start 0x7f090010 int id start 0x7f090010
int id title_new_devices 0x7f090014 int id title_new_devices 0x7f090014
int id title_paired_devices 0x7f090012 int id title_paired_devices 0x7f090012
int id top 0x7f090011 int id top 0x7f090011
int id txtDate 0x7f09001f
int id txtMessage 0x7f090020
int id txtSender 0x7f09001e
int id vertical 0x7f090001 int id vertical 0x7f090001
int layout activity_device_list 0x7f030000 int layout activity_device_list 0x7f030000
int layout activity_main 0x7f030001 int layout activity_main 0x7f030001
int layout device_name 0x7f030002 int layout device_name 0x7f030002
int layout fragment_bluetooth_chat 0x7f030003 int layout fragment_bluetooth_chat 0x7f030003
int layout message 0x7f030004 int layout message 0x7f030004
int layout message_left 0x7f030005
int layout message_right 0x7f030006
int menu bluetooth_chat 0x7f080000 int menu bluetooth_chat 0x7f080000
int menu main 0x7f080001 int menu main 0x7f080001
int string app_name 0x7f070000 int string app_name 0x7f070000
......
...@@ -298,7 +298,9 @@ public class BluetoothChatFragment extends Fragment { ...@@ -298,7 +298,9 @@ public class BluetoothChatFragment extends Fragment {
case Constants.MESSAGE_WRITE: case Constants.MESSAGE_WRITE:
byte[] writeBuf = (byte[]) msg.obj; byte[] writeBuf = (byte[]) msg.obj;
// construct a string from the buffer // construct a string from the buffer
String writeMessage = new String(writeBuf); String writeMessage = new String(writeBuf);
mConversationArrayAdapter.add("Me: " + writeMessage); mConversationArrayAdapter.add("Me: " + writeMessage);
break; break;
case Constants.MESSAGE_READ: case Constants.MESSAGE_READ:
......
...@@ -27,6 +27,7 @@ import android.os.Message; ...@@ -27,6 +27,7 @@ import android.os.Message;
import com.example.android.common.logger.Log; import com.example.android.common.logger.Log;
import java.io.ByteArrayInputStream;
import java.io.IOException; import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.io.OutputStream; import java.io.OutputStream;
...@@ -67,6 +68,8 @@ public class BluetoothChatService { ...@@ -67,6 +68,8 @@ public class BluetoothChatService {
public static final int STATE_CONNECTING = 2; // now initiating an outgoing connection public static final int STATE_CONNECTING = 2; // now initiating an outgoing connection
public static final int STATE_CONNECTED = 3; // now connected to a remote device public static final int STATE_CONNECTED = 3; // now connected to a remote device
public int messageBluetooth;
/** /**
* Constructor. Prepares a new BluetoothChat session. * Constructor. Prepares a new BluetoothChat session.
* *
...@@ -85,7 +88,7 @@ public class BluetoothChatService { ...@@ -85,7 +88,7 @@ public class BluetoothChatService {
* @param state An integer defining the current connection state * @param state An integer defining the current connection state
*/ */
private synchronized void setState(int state) { private synchronized void setState(int state) {
Log.d(TAG, "setState() " + mState + " -> " + state); // Log.d(TAG, "setState() " + mState + " -> " + state);
mState = state; mState = state;
// Give the new state to the Handler so the UI Activity can update // Give the new state to the Handler so the UI Activity can update
...@@ -168,7 +171,9 @@ public class BluetoothChatService { ...@@ -168,7 +171,9 @@ public class BluetoothChatService {
*/ */
public synchronized void connected(BluetoothSocket socket, BluetoothDevice public synchronized void connected(BluetoothSocket socket, BluetoothDevice
device, final String socketType) { device, final String socketType) {
Log.d(TAG, "connected, Socket Type:" + socketType); //Log.d(TAG, "connected, Socket Type:" + socketType);
Log.d(TAG, "connected");
// Cancel the thread that completed the connection // Cancel the thread that completed the connection
if (mConnectThread != null) { if (mConnectThread != null) {
...@@ -272,6 +277,7 @@ public class BluetoothChatService { ...@@ -272,6 +277,7 @@ public class BluetoothChatService {
*/ */
private void connectionLost() { private void connectionLost() {
// Send a failure message back to the Activity // Send a failure message back to the Activity
Log.d(TAG, "Disconected");
Message msg = mHandler.obtainMessage(Constants.MESSAGE_TOAST); Message msg = mHandler.obtainMessage(Constants.MESSAGE_TOAST);
Bundle bundle = new Bundle(); Bundle bundle = new Bundle();
bundle.putString(Constants.TOAST, "Device connection was lost"); bundle.putString(Constants.TOAST, "Device connection was lost");
...@@ -306,14 +312,14 @@ public class BluetoothChatService { ...@@ -306,14 +312,14 @@ public class BluetoothChatService {
NAME_INSECURE, MY_UUID_INSECURE); NAME_INSECURE, MY_UUID_INSECURE);
} }
} catch (IOException e) { } catch (IOException e) {
Log.e(TAG, "Socket Type: " + mSocketType + "listen() failed", e); //Log.e(TAG, "Socket Type: " + mSocketType + "listen() failed", e);
} }
mmServerSocket = tmp; mmServerSocket = tmp;
} }
public void run() { public void run() {
Log.d(TAG, "Socket Type: " + mSocketType + //Log.d(TAG, "Socket Type: " + mSocketType +
"BEGIN mAcceptThread" + this); //"BEGIN mAcceptThread" + this);
setName("AcceptThread" + mSocketType); setName("AcceptThread" + mSocketType);
BluetoothSocket socket = null; BluetoothSocket socket = null;
...@@ -325,7 +331,7 @@ public class BluetoothChatService { ...@@ -325,7 +331,7 @@ public class BluetoothChatService {
// successful connection or an exception // successful connection or an exception
socket = mmServerSocket.accept(); socket = mmServerSocket.accept();
} catch (IOException e) { } catch (IOException e) {
Log.e(TAG, "Socket Type: " + mSocketType + "accept() failed", e); //Log.e(TAG, "Socket Type: " + mSocketType + "accept() failed", e);
break; break;
} }
...@@ -345,23 +351,23 @@ public class BluetoothChatService { ...@@ -345,23 +351,23 @@ public class BluetoothChatService {
try { try {
socket.close(); socket.close();
} catch (IOException e) { } catch (IOException e) {
Log.e(TAG, "Could not close unwanted socket", e); //Log.e(TAG, "Could not close unwanted socket", e);
} }
break; break;
} }
} }
} }
} }
Log.i(TAG, "END mAcceptThread, socket Type: " + mSocketType); //Log.i(TAG, "END mAcceptThread, socket Type: " + mSocketType);
} }
public void cancel() { public void cancel() {
Log.d(TAG, "Socket Type" + mSocketType + "cancel " + this); //Log.d(TAG, "Socket Type" + mSocketType + "cancel " + this);
try { try {
mmServerSocket.close(); mmServerSocket.close();
} catch (IOException e) { } catch (IOException e) {
Log.e(TAG, "Socket Type" + mSocketType + "close() of server failed", e); // Log.e(TAG, "Socket Type" + mSocketType + "close() of server failed", e);
} }
} }
} }
...@@ -393,13 +399,13 @@ public class BluetoothChatService { ...@@ -393,13 +399,13 @@ public class BluetoothChatService {
MY_UUID_INSECURE); MY_UUID_INSECURE);
} }
} catch (IOException e) { } catch (IOException e) {
Log.e(TAG, "Socket Type: " + mSocketType + "create() failed", e); // Log.e(TAG, "Socket Type: " + mSocketType + "create() failed", e);
} }
mmSocket = tmp; mmSocket = tmp;
} }
public void run() { public void run() {
Log.i(TAG, "BEGIN mConnectThread SocketType:" + mSocketType); //Log.i(TAG, "BEGIN mConnectThread SocketType:" + mSocketType);
setName("ConnectThread" + mSocketType); setName("ConnectThread" + mSocketType);
// Always cancel discovery because it will slow down a connection // Always cancel discovery because it will slow down a connection
...@@ -415,8 +421,8 @@ public class BluetoothChatService { ...@@ -415,8 +421,8 @@ public class BluetoothChatService {
try { try {
mmSocket.close(); mmSocket.close();
} catch (IOException e2) { } catch (IOException e2) {
Log.e(TAG, "unable to close() " + mSocketType + // Log.e(TAG, "unable to close() " + mSocketType +
" socket during connection failure", e2); // " socket during connection failure", e2);
} }
connectionFailed(); connectionFailed();
return; return;
...@@ -435,7 +441,7 @@ public class BluetoothChatService { ...@@ -435,7 +441,7 @@ public class BluetoothChatService {
try { try {
mmSocket.close(); mmSocket.close();
} catch (IOException e) { } catch (IOException e) {
Log.e(TAG, "close() of connect " + mSocketType + " socket failed", e); // Log.e(TAG, "close() of connect " + mSocketType + " socket failed", e);
} }
} }
} }
...@@ -450,7 +456,7 @@ public class BluetoothChatService { ...@@ -450,7 +456,7 @@ public class BluetoothChatService {
private final OutputStream mmOutStream; private final OutputStream mmOutStream;
public ConnectedThread(BluetoothSocket socket, String socketType) { public ConnectedThread(BluetoothSocket socket, String socketType) {
Log.d(TAG, "create ConnectedThread: " + socketType); // Log.d(TAG, "create ConnectedThread: " + socketType);
mmSocket = socket; mmSocket = socket;
InputStream tmpIn = null; InputStream tmpIn = null;
OutputStream tmpOut = null; OutputStream tmpOut = null;
...@@ -460,7 +466,7 @@ public class BluetoothChatService { ...@@ -460,7 +466,7 @@ public class BluetoothChatService {
tmpIn = socket.getInputStream(); tmpIn = socket.getInputStream();
tmpOut = socket.getOutputStream(); tmpOut = socket.getOutputStream();
} catch (IOException e) { } catch (IOException e) {
Log.e(TAG, "temp sockets not created", e); // Log.e(TAG, "temp sockets not created", e);
} }
mmInStream = tmpIn; mmInStream = tmpIn;
...@@ -468,7 +474,7 @@ public class BluetoothChatService { ...@@ -468,7 +474,7 @@ public class BluetoothChatService {
} }
public void run() { public void run() {
Log.i(TAG, "BEGIN mConnectedThread"); //Log.i(TAG, "BEGIN mConnectedThread");
byte[] buffer = new byte[1024]; byte[] buffer = new byte[1024];
int bytes; int bytes;
...@@ -478,11 +484,13 @@ public class BluetoothChatService { ...@@ -478,11 +484,13 @@ public class BluetoothChatService {
// Read from the InputStream // Read from the InputStream
bytes = mmInStream.read(buffer); bytes = mmInStream.read(buffer);
Log.d(TAG, "Hexa da MSG: " + toHexString(buffer,bytes));
// Send the obtained bytes to the UI Activity // Send the obtained bytes to the UI Activity
mHandler.obtainMessage(Constants.MESSAGE_READ, bytes, -1, buffer) mHandler.obtainMessage(Constants.MESSAGE_READ, bytes, -1, buffer)
.sendToTarget(); .sendToTarget();
} catch (IOException e) { } catch (IOException e) {
Log.e(TAG, "disconnected", e); // Log.e(TAG, "disconnected", e);
connectionLost(); connectionLost();
// Start the service over to restart listening mode // Start the service over to restart listening mode
BluetoothChatService.this.start(); BluetoothChatService.this.start();
...@@ -500,11 +508,13 @@ public class BluetoothChatService { ...@@ -500,11 +508,13 @@ public class BluetoothChatService {
try { try {
mmOutStream.write(buffer); mmOutStream.write(buffer);
/////////Log.d(TAG, "Hexa da MSG escrita: " + toHexString(buffer));
// Share the sent message back to the UI Activity // Share the sent message back to the UI Activity
mHandler.obtainMessage(Constants.MESSAGE_WRITE, -1, -1, buffer) mHandler.obtainMessage(Constants.MESSAGE_WRITE, -1, -1, buffer)
.sendToTarget(); .sendToTarget();
} catch (IOException e) { } catch (IOException e) {
Log.e(TAG, "Exception during write", e); //Log.e(TAG, "Exception during write", e);
} }
} }
...@@ -512,8 +522,23 @@ public class BluetoothChatService { ...@@ -512,8 +522,23 @@ public class BluetoothChatService {
try { try {
mmSocket.close(); mmSocket.close();
} catch (IOException e) { } catch (IOException e) {
Log.e(TAG, "close() of connect socket failed", e); //Log.e(TAG, "close() of connect socket failed", e);
} }
} }
public String toHexString(byte[] bytes, int num)
{
final char[] HEX_CHARS = {
'0', '1', '2' ,'3', '4', '5', '6', '7', '8', '9',
'a', 'b', 'c', 'd', 'e', 'f'
};
StringBuilder sb = new StringBuilder();
for(int i = 0; i < bytes.length && i < num; i++) {
byte b = bytes[i];
sb.append(new char[] {HEX_CHARS[(b >> 4) & 0x0f], HEX_CHARS[b & 0x0f]});
}
return sb.toString();
}
} }
} }
...@@ -62,17 +62,17 @@ public class MainActivity extends SampleActivityBase { ...@@ -62,17 +62,17 @@ public class MainActivity extends SampleActivityBase {
return true; return true;
} }
/*@Override @Override
public boolean onPrepareOptionsMenu(Menu menu) { public boolean onPrepareOptionsMenu(Menu menu) {
MenuItem logToggle = menu.findItem(R.id.menu_toggle_log); MenuItem logToggle = menu.findItem(R.id.menu_toggle_log);
logToggle.setVisible(findViewById(R.id.sample_output) instanceof ViewAnimator); logToggle.setVisible(findViewById(R.id.sample_output) instanceof ViewAnimator);
logToggle.setTitle(mLogShown ? R.string.sample_hide_log : R.string.sample_show_log); logToggle.setTitle(mLogShown ? R.string.sample_hide_log : R.string.sample_show_log);
return super.onPrepareOptionsMenu(menu); return super.onPrepareOptionsMenu(menu);
}*/ }
//@Override @Override
/*public boolean onOptionsItemSelected(MenuItem item) { public boolean onOptionsItemSelected(MenuItem item) {
switch(item.getItemId()) { switch(item.getItemId()) {
case R.id.menu_toggle_log: case R.id.menu_toggle_log:
mLogShown = !mLogShown; mLogShown = !mLogShown;
...@@ -86,7 +86,7 @@ public class MainActivity extends SampleActivityBase { ...@@ -86,7 +86,7 @@ public class MainActivity extends SampleActivityBase {
return true; return true;
} }
return super.onOptionsItemSelected(item); return super.onOptionsItemSelected(item);
}*/ }
/** Create a chain of targets that will receive log data */ /** Create a chain of targets that will receive log data */
@Override @Override
...@@ -101,9 +101,9 @@ public class MainActivity extends SampleActivityBase { ...@@ -101,9 +101,9 @@ public class MainActivity extends SampleActivityBase {
logWrapper.setNext(msgFilter); logWrapper.setNext(msgFilter);
// On screen logging via a fragment with a TextView. // On screen logging via a fragment with a TextView.
/*LogFragment logFragment = (LogFragment) getSupportFragmentManager() LogFragment logFragment = (LogFragment) getSupportFragmentManager()
.findFragmentById(R.id.log_fragment); .findFragmentById(R.id.log_fragment);
msgFilter.setNext(logFragment.getLogView());*/ msgFilter.setNext(logFragment.getLogView());
Log.i(TAG, "Ready"); Log.i(TAG, "Ready");
} }
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
android:layout_height="match_parent" android:layout_height="match_parent"
android:id="@+id/sample_main_layout"> android:id="@+id/sample_main_layout">
<!--<ViewAnimator <ViewAnimator
android:id="@+id/sample_output" android:id="@+id/sample_output"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="0px" android:layout_height="0px"
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
android:paddingRight="@dimen/horizontal_page_margin" android:paddingRight="@dimen/horizontal_page_margin"
android:paddingTop="@dimen/vertical_page_margin" android:paddingTop="@dimen/vertical_page_margin"
android:paddingBottom="@dimen/vertical_page_margin" android:paddingBottom="@dimen/vertical_page_margin"
android:text="@string/intro_message" /> android:text="" />
</ScrollView> </ScrollView>
<fragment <fragment
...@@ -48,7 +48,7 @@ ...@@ -48,7 +48,7 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" /> android:layout_height="match_parent" />
</ViewAnimator>--> </ViewAnimator>
<View <View
android:layout_width="match_parent" android:layout_width="match_parent"
......
...@@ -15,9 +15,10 @@ ...@@ -15,9 +15,10 @@
limitations under the License. limitations under the License.
--> -->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:orientation="vertical" > xmlns:tools="http://schemas.android.com/tools"
android:orientation="vertical">
<ListView <ListView
android:id="@+id/in" android:id="@+id/in"
...@@ -25,7 +26,8 @@ ...@@ -25,7 +26,8 @@
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_weight="1" android:layout_weight="1"
android:stackFromBottom="true" android:stackFromBottom="true"
android:transcriptMode="alwaysScroll" /> android:transcriptMode="alwaysScroll"
tools:listitem="@layout/message_right"/>
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
......
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="10dp">
<RelativeLayout android:layout_width="fill_parent" android:layout_height="fill_parent"
android:layout_marginRight="10dp">
<TextView
android:id="@+id/txtSender"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:text=""
android:textSize="16sp"
android:singleLine="true"
android:layout_alignParentLeft="true"
android:paddingLeft="10dp"
android:paddingBottom="6dp"
android:textColor="@android:color/black" android:textStyle="bold"/>
<TextView
android:id="@+id/txtDate"
android:layout_alignParentRight="true"
android:textColor="@android:color/holo_purple"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingRight="2dp"
android:paddingBottom="6dp"
android:textSize="12sp"
android:text=""
android:layout_alignBottom="@+id/txtSender"/>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/txtSender"
android:layout_alignParentLeft="true"
android:padding="12dp"
android:background="@android:color/darker_gray"
>
<TextView
android:id="@+id/txtMessage"
android:paddingLeft="12dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@android:color/black"
android:textSize="14sp"
android:text="Hello"
/>
</RelativeLayout>
</RelativeLayout>
</RelativeLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="10dp">
<RelativeLayout android:layout_width="fill_parent" android:layout_height="fill_parent"
android:layout_marginLeft="10dp">
<TextView
android:id="@+id/txtSender"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:text=""
android:textSize="16sp"
android:singleLine="true"
android:layout_alignParentRight="true"
android:paddingRight="10dp"
android:paddingBottom="6dp"
android:textColor="@android:color/black" android:textStyle="bold"/>
<TextView
android:id="@+id/txtDate"
android:layout_alignParentLeft="true"
android:textColor="@android:color/holo_purple"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="2dp"
android:paddingBottom="6dp"
android:textSize="12sp"
android:text=""
android:layout_alignBottom="@+id/txtSender"
/>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/txtSender"
android:layout_alignParentRight="true"
android:padding="12dp"
android:background="@android:color/holo_purple"
>
<TextView
android:id="@+id/txtMessage"
android:paddingRight="12dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:textColor="@android:color/white"
android:textSize="14sp"
android:text="Hello, how are you?"
/>
</RelativeLayout>
</RelativeLayout>
</RelativeLayout>
\ No newline at end of file
...@@ -17,5 +17,5 @@ ...@@ -17,5 +17,5 @@
<menu xmlns:android="http://schemas.android.com/apk/res/android"> <menu xmlns:android="http://schemas.android.com/apk/res/android">
<item android:id="@+id/menu_toggle_log" <item android:id="@+id/menu_toggle_log"
android:showAsAction="always" android:showAsAction="always"
android:title="" /> android:title="Show log" />
</menu> </menu>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment