mirror of
https://gitlab.futo.org/keyboard/latinime.git
synced 2024-09-28 14:54:30 +01:00
Use Key background for suggestions strip control
Change-Id: I5e43c0919e89972283fd18eb29d69f96f1bd0290
This commit is contained in:
parent
c190da0e02
commit
e583371b13
@ -40,22 +40,18 @@
|
|||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
|
android:minWidth="28dp"
|
||||||
android:textSize="@dimen/candidate_text_size"
|
android:textSize="@dimen/candidate_text_size"
|
||||||
android:paddingRight="8dp"
|
android:visibility="visible" />
|
||||||
android:paddingLeft="8dp"
|
|
||||||
android:visibility="visible"
|
|
||||||
android:background="@drawable/btn_keyboard_key_ics" />
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/close_candidates_pane"
|
android:id="@+id/close_candidates_pane"
|
||||||
android:text="@string/label_close_candidates_pane"
|
android:text="@string/label_close_candidates_pane"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
|
android:minWidth="28dp"
|
||||||
android:textSize="@dimen/candidate_text_size"
|
android:textSize="@dimen/candidate_text_size"
|
||||||
android:paddingRight="8dp"
|
android:visibility="gone" />
|
||||||
android:paddingLeft="8dp"
|
|
||||||
android:visibility="gone"
|
|
||||||
android:background="@drawable/btn_keyboard_key_ics" />
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/touch_to_save"
|
android:id="@+id/touch_to_save"
|
||||||
|
@ -21,6 +21,7 @@ import android.content.res.Resources;
|
|||||||
import android.content.res.TypedArray;
|
import android.content.res.TypedArray;
|
||||||
import android.graphics.Color;
|
import android.graphics.Color;
|
||||||
import android.graphics.Typeface;
|
import android.graphics.Typeface;
|
||||||
|
import android.graphics.drawable.Drawable;
|
||||||
import android.os.Message;
|
import android.os.Message;
|
||||||
import android.text.Spannable;
|
import android.text.Spannable;
|
||||||
import android.text.SpannableString;
|
import android.text.SpannableString;
|
||||||
@ -330,9 +331,18 @@ public class CandidateView extends LinearLayout implements OnClickListener, OnLo
|
|||||||
mInvertedForegroundColorSpan = new ForegroundColorSpan(mColorTypedWord ^ 0x00ffffff);
|
mInvertedForegroundColorSpan = new ForegroundColorSpan(mColorTypedWord ^ 0x00ffffff);
|
||||||
mInvertedBackgroundColorSpan = new BackgroundColorSpan(mColorTypedWord);
|
mInvertedBackgroundColorSpan = new BackgroundColorSpan(mColorTypedWord);
|
||||||
|
|
||||||
|
final TypedArray keyboardViewAttr = context.obtainStyledAttributes(
|
||||||
|
attrs, R.styleable.KeyboardView, R.attr.keyboardViewStyle, R.style.KeyboardView);
|
||||||
|
final Drawable keyBackground = keyboardViewAttr.getDrawable(
|
||||||
|
R.styleable.KeyboardView_keyBackground);
|
||||||
|
final int keyTextColor = keyboardViewAttr.getColor(
|
||||||
|
R.styleable.KeyboardView_keyTextColor, 0xFF000000);
|
||||||
|
keyboardViewAttr.recycle();
|
||||||
|
|
||||||
mCandidatesPaneControl = (ViewGroup)findViewById(R.id.candidates_pane_control);
|
mCandidatesPaneControl = (ViewGroup)findViewById(R.id.candidates_pane_control);
|
||||||
mExpandCandidatesPane = (TextView)findViewById(R.id.expand_candidates_pane);
|
mExpandCandidatesPane = (TextView)findViewById(R.id.expand_candidates_pane);
|
||||||
mExpandCandidatesPane.getBackground().setAlpha(180);
|
mExpandCandidatesPane.setBackgroundDrawable(keyBackground);
|
||||||
|
mExpandCandidatesPane.setTextColor(keyTextColor);
|
||||||
mExpandCandidatesPane.setOnClickListener(new OnClickListener() {
|
mExpandCandidatesPane.setOnClickListener(new OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View view) {
|
public void onClick(View view) {
|
||||||
@ -340,7 +350,8 @@ public class CandidateView extends LinearLayout implements OnClickListener, OnLo
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
mCloseCandidatesPane = (TextView)findViewById(R.id.close_candidates_pane);
|
mCloseCandidatesPane = (TextView)findViewById(R.id.close_candidates_pane);
|
||||||
mCloseCandidatesPane.getBackground().setAlpha(180);
|
mCloseCandidatesPane.setBackgroundDrawable(keyBackground);
|
||||||
|
mCloseCandidatesPane.setTextColor(keyTextColor);
|
||||||
mCloseCandidatesPane.setOnClickListener(new OnClickListener() {
|
mCloseCandidatesPane.setOnClickListener(new OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View view) {
|
public void onClick(View view) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user