mirror of
https://github.com/moparisthebest/Yaaic
synced 2024-11-25 10:22:16 -05:00
Fullscreen chat implementation. pans window instead of resizing, not easly fixable
This commit is contained in:
parent
a5d81a1350
commit
93e77ea6ed
@ -73,7 +73,7 @@ along with Yaaic. If not, see <http://www.gnu.org/licenses/>.
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:inputType="textImeMultiLine"
|
||||
android:imeOptions="actionSend" />
|
||||
android:imeOptions="actionSend|flagNoExtractUi" />
|
||||
<Button
|
||||
android:id="@+id/speech"
|
||||
android:layout_width="wrap_content"
|
||||
|
@ -54,6 +54,9 @@
|
||||
<string name="key_autocap_sentences">autocap_sentences</string>
|
||||
<string name="default_autocap_sentences">false</string>
|
||||
|
||||
<string name="key_fullscreen_conversation">fullscreen conversation</string>
|
||||
<string name="default_fullscreen_conversation">false</string>
|
||||
|
||||
<string name="key_history_size">history_size</string>
|
||||
<string name="default_history_size">30</string>
|
||||
</resources>
|
||||
|
@ -220,6 +220,8 @@
|
||||
<string name="settings_autocorrect_text_desc">Use dictionary to autocorrect typed text in chat</string>
|
||||
<string name="settings_autocap_sentences_title">Auto-capitalize sentences</string>
|
||||
<string name="settings_autocap_sentences_desc">Automatically capitalize the first word of sentences</string>
|
||||
<string name="settings_fullscreen_conversation_title">Fullscreen chat window</string>
|
||||
<string name="settings_fullscreen_conversation_desc">Automatically fullscreen the conversation when focused</string>
|
||||
<string name="settings_history_size_title">History size</string>
|
||||
<string name="settings_history_size_desc">Number of lines of conversation history to keep</string>
|
||||
</resources>
|
||||
|
@ -104,6 +104,11 @@ along with Yaaic. If not, see <http://www.gnu.org/licenses/>.
|
||||
android:summary="@string/settings_autocap_sentences_desc"
|
||||
android:key="@string/key_autocap_sentences"
|
||||
android:defaultValue="@string/default_autocap_sentences" />
|
||||
<CheckBoxPreference
|
||||
android:title="@string/settings_fullscreen_conversation_title"
|
||||
android:summary="@string/settings_fullscreen_conversation_desc"
|
||||
android:key="@string/key_fullscreen_conversation"
|
||||
android:defaultValue="@string/default_fullscreen_conversation" />
|
||||
<EditTextPreference
|
||||
android:title="@string/settings_history_size_title"
|
||||
android:summary="@string/settings_history_size_desc"
|
||||
|
@ -76,6 +76,7 @@ import android.view.MenuInflater;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.view.Window;
|
||||
import android.view.WindowManager;
|
||||
import android.view.View.OnKeyListener;
|
||||
import android.view.inputmethod.InputMethodManager;
|
||||
import android.widget.Button;
|
||||
@ -179,6 +180,7 @@ public class ConversationActivity extends Activity implements ServiceConnection,
|
||||
|
||||
serverId = getIntent().getExtras().getInt("serverId");
|
||||
server = Yaaic.getInstance().getServerById(serverId);
|
||||
Settings settings = new Settings(this);
|
||||
|
||||
// Finish activity if server does not exist anymore - See #55
|
||||
if (server == null) {
|
||||
@ -188,6 +190,9 @@ public class ConversationActivity extends Activity implements ServiceConnection,
|
||||
setTitle("Yaaic - " + server.getTitle());
|
||||
|
||||
setContentView(R.layout.conversations);
|
||||
if (settings.fullscreenConversations()){
|
||||
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
|
||||
}
|
||||
|
||||
boolean isLandscape = (getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE);
|
||||
|
||||
@ -208,7 +213,6 @@ public class ConversationActivity extends Activity implements ServiceConnection,
|
||||
deck.setOnItemClickListener(new ConversationClickListener(deckAdapter, switcher));
|
||||
deck.setBackgroundDrawable(new NonScalingBackgroundDrawable(this, deck, R.drawable.background));
|
||||
|
||||
Settings settings = new Settings(this);
|
||||
historySize = settings.getHistorySize();
|
||||
|
||||
if (server.getStatus() == Status.PRE_CONNECTING) {
|
||||
|
@ -283,6 +283,17 @@ public class Settings
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether conversations should be viewed in Fullscreen glory
|
||||
*/
|
||||
public boolean fullscreenConversations()
|
||||
{
|
||||
return preferences.getBoolean(
|
||||
resources.getString(R.string.key_fullscreen_conversation),
|
||||
Boolean.parseBoolean(resources.getString(R.string.default_fullscreen_conversation))
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the conversation history size.
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user