mirror of
https://github.com/lubosz/overte.git
synced 2025-04-07 19:22:39 +02:00
Customize SearchView in GoTo activity
This commit is contained in:
parent
3fc78da1f5
commit
a9f44fb8ed
5 changed files with 31 additions and 1 deletions
|
@ -2,6 +2,7 @@ package io.highfidelity.hifiinterface;
|
|||
|
||||
import android.app.ProgressDialog;
|
||||
import android.content.Intent;
|
||||
import android.graphics.Color;
|
||||
import android.os.AsyncTask;
|
||||
import android.os.Bundle;
|
||||
import android.support.v4.view.GravityCompat;
|
||||
|
@ -14,6 +15,7 @@ import android.support.v7.widget.Toolbar;
|
|||
import android.view.Menu;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.widget.SearchView;
|
||||
import android.widget.TabHost;
|
||||
import android.widget.TabWidget;
|
||||
import android.widget.TextView;
|
||||
|
@ -85,6 +87,16 @@ public class GotoActivity extends AppCompatActivity {
|
|||
});
|
||||
domainsView.setAdapter(domainAdapter);
|
||||
|
||||
SearchView searchView = findViewById(R.id.searchView);
|
||||
int searchPlateId = searchView.getContext().getResources().getIdentifier("android:id/search_plate", null, null);
|
||||
View searchPlate = searchView.findViewById(searchPlateId);
|
||||
if (searchPlate!=null) {
|
||||
searchPlate.setBackgroundColor (Color.TRANSPARENT);
|
||||
int searchTextId = searchPlate.getContext ().getResources ().getIdentifier ("android:id/search_src_text", null, null);
|
||||
TextView searchTextView = searchView.findViewById(searchTextId);
|
||||
searchTextView.setTextAppearance(R.style.SearchText);
|
||||
}
|
||||
|
||||
preloadQt();
|
||||
|
||||
showActivityIndicator();
|
||||
|
|
7
android/app/src/main/res/font/raleway_light_italic.xml
Normal file
7
android/app/src/main/res/font/raleway_light_italic.xml
Normal file
|
@ -0,0 +1,7 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<font-family xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
app:fontProviderAuthority="com.google.android.gms.fonts"
|
||||
app:fontProviderPackage="com.google.android.gms"
|
||||
app:fontProviderQuery="name=Raleway&weight=300&italic=1"
|
||||
app:fontProviderCerts="@array/com_google_android_gms_fonts_certs">
|
||||
</font-family>
|
|
@ -29,9 +29,14 @@
|
|||
android:background="@color/backgroundDark"/>
|
||||
|
||||
<SearchView
|
||||
android:id="@+id/searchView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="42dp"
|
||||
android:background="@drawable/search_bg"/>
|
||||
android:background="@drawable/search_bg"
|
||||
android:gravity="right"
|
||||
android:layout_gravity="right"
|
||||
|
||||
/>
|
||||
<FrameLayout
|
||||
android:id="@android:id/tabcontent"
|
||||
android:layout_width="match_parent"
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
<resources>
|
||||
<array name="preloaded_fonts" translatable="false">
|
||||
<item>@font/raleway_bold</item>
|
||||
<item>@font/raleway_light_italic</item>
|
||||
<item>@font/raleway_medium</item>
|
||||
<item>@font/raleway_semibold</item>
|
||||
</array>
|
||||
|
|
|
@ -33,6 +33,11 @@
|
|||
<item name="android:padding">0dp</item>
|
||||
</style>
|
||||
|
||||
<style name="SearchText">
|
||||
<item name="android:fontFamily">@font/raleway_light_italic</item>
|
||||
<item name="android:textSize">15sp</item>
|
||||
</style>
|
||||
|
||||
<!-- Overriding text size so it's not so big in portrait -->
|
||||
<style name="ActionBarTitleStyle"
|
||||
parent="@android:style/TextAppearance.Material.Widget.ActionBar.Title">
|
||||
|
|
Loading…
Reference in a new issue