kopia lustrzana https://github.com/ge0rg/aprsdroid
messaging: only change outgoing msgs
rodzic
ae90a4c7c6
commit
fff15609fa
|
@ -30,6 +30,10 @@
|
|||
android:launchMode="singleTop"
|
||||
android:configChanges="orientation|keyboardHidden"
|
||||
/>
|
||||
<activity android:name=".ConversationsActivity" android:label="@string/app_messages"
|
||||
android:launchMode="singleTop"
|
||||
android:configChanges="orientation|keyboardHidden"
|
||||
/>
|
||||
<activity android:name=".StationActivity" android:label="@string/app_sta"
|
||||
android:configChanges="orientation|keyboardHidden"
|
||||
/>
|
||||
|
|
|
@ -0,0 +1,30 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent"
|
||||
android:orientation="vertical"
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
>
|
||||
<ListView
|
||||
android:id="@android:id/list"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="100sp"
|
||||
android:layout_weight="1"
|
||||
android:focusable="true"
|
||||
android:focusableInTouchMode="true"
|
||||
android:descendantFocusability="blocksDescendants"
|
||||
/>
|
||||
<TextView
|
||||
android:id="@+id/android:empty"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="100sp"
|
||||
android:layout_weight="2"
|
||||
android:textSize="18sp"
|
||||
android:text="@string/msg_empty_list"/>
|
||||
<Button
|
||||
android:id="@+id/new_conversation"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/msg_send_new"
|
||||
/>
|
||||
</LinearLayout>
|
|
@ -0,0 +1,49 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
<LinearLayout
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal">
|
||||
<TextView
|
||||
android:id="@+id/call"
|
||||
android:layout_width="20dp"
|
||||
android:layout_weight="0.4"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginRight="5dp"
|
||||
android:textColor="#b0b080"
|
||||
android:textSize="24dp"
|
||||
android:ellipsize="marquee"
|
||||
android:typeface="monospace"
|
||||
/>
|
||||
<LinearLayout
|
||||
android:layout_width="30dp"
|
||||
android:layout_weight="0.6"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical">
|
||||
<TextView
|
||||
android:id="@+id/ts"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="#b0b0b0"
|
||||
android:textSize="16dp"
|
||||
/>
|
||||
<TextView
|
||||
android:id="@+id/message"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="#8080b0"
|
||||
android:textSize="16dp"
|
||||
android:typeface="monospace"
|
||||
android:focusable="false"
|
||||
android:ellipsize="marquee"
|
||||
android:singleLine="true"
|
||||
/>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
|
@ -11,6 +11,10 @@
|
|||
android:title="@string/show_log"
|
||||
android:alphabeticShortcut="l"
|
||||
android:icon="@android:drawable/ic_menu_recent_history" />
|
||||
<item android:id="@+id/conversations"
|
||||
android:title="@string/app_messages"
|
||||
android:alphabeticShortcut="c"
|
||||
android:icon="@android:drawable/ic_menu_send" />
|
||||
<item android:id="@+id/age"
|
||||
android:title="@string/age"
|
||||
android:alphabeticShortcut="a"
|
||||
|
|
|
@ -33,6 +33,11 @@
|
|||
<string name="sta_aprsfi">aprs.fi</string>
|
||||
<string name="sta_qrzcom">QRZ.com</string>
|
||||
|
||||
<!-- Conversations activity -->
|
||||
<string name="msg_send_new">Send message to...</string>
|
||||
<string name="msg_message_text">Message text</string>
|
||||
<string name="msg_empty_list">There are no stored conversations.</string>
|
||||
|
||||
<!-- AprsService -->
|
||||
<string name="aprsservice">APRSdroid Service</string>
|
||||
<string name="service_once">APRS Service single shot.</string>
|
||||
|
|
|
@ -356,7 +356,7 @@ class StorageDatabase(context : Context) extends
|
|||
def updateMessageAcked(call : String, msgid : String, new_type : Int) = {
|
||||
val cv = new ContentValues()
|
||||
cv.put(Message.TYPE, new_type.asInstanceOf[java.lang.Integer])
|
||||
getWritableDatabase().update(Message.TABLE, cv, "call = ? and msgid = ?",
|
||||
getWritableDatabase().update(Message.TABLE, cv, "type = 2 AND call = ? AND msgid = ?",
|
||||
Array(call, msgid))
|
||||
}
|
||||
|
||||
|
@ -373,4 +373,12 @@ class StorageDatabase(context : Context) extends
|
|||
c.close()
|
||||
result
|
||||
}
|
||||
|
||||
def getConversations() = {
|
||||
getReadableDatabase().query(Message.TABLE, Message.COLUMNS,
|
||||
null, null,
|
||||
"call", null,
|
||||
"_id DESC", null)
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -188,9 +188,10 @@ trait UIHelper extends Activity
|
|||
mi.setTitle(if (AprsService.running) R.string.stoplog else R.string.startlog)
|
||||
mi.setIcon(if (AprsService.running) android.R.drawable.ic_menu_close_clear_cancel else android.R.drawable.ic_menu_compass)
|
||||
// disable the "own" menu
|
||||
Array(R.id.hub, R.id.map, R.id.log).map((id) => {
|
||||
Array(R.id.hub, R.id.map, R.id.log, R.id.conversations).map((id) => {
|
||||
menu.findItem(id).setVisible(id != menu_id)
|
||||
})
|
||||
menu.findItem(R.id.age).setVisible(R.id.map == menu_id || R.id.hub == menu_id)
|
||||
menu.findItem(R.id.overlays).setVisible(R.id.map == menu_id)
|
||||
menu.findItem(R.id.objects).setChecked(prefs.getShowObjects())
|
||||
menu.findItem(R.id.satellite).setChecked(prefs.getShowSatellite())
|
||||
|
@ -222,6 +223,9 @@ trait UIHelper extends Activity
|
|||
case R.id.log =>
|
||||
startActivity(new Intent(this, classOf[LogActivity]));
|
||||
true
|
||||
case R.id.conversations =>
|
||||
startActivity(new Intent(this, classOf[ConversationsActivity]));
|
||||
true
|
||||
// toggle service
|
||||
case R.id.startstopbtn =>
|
||||
val is_running = AprsService.running
|
||||
|
|
Ładowanie…
Reference in New Issue