mirror of
https://github.com/lubosz/overte.git
synced 2025-04-08 04:42:20 +02:00
Align UI of Go To activity
This commit is contained in:
parent
0068e5dc0f
commit
7be11fc697
12 changed files with 83 additions and 24 deletions
|
@ -32,6 +32,7 @@ public class GotoActivity extends AppCompatActivity {
|
|||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_goto);
|
||||
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
|
||||
toolbar.setTitleTextAppearance(this, R.style.GotoActionBarTitleStyle);
|
||||
setSupportActionBar(toolbar);
|
||||
|
||||
ActionBar actionbar = getSupportActionBar();
|
||||
|
@ -63,7 +64,7 @@ public class GotoActivity extends AppCompatActivity {
|
|||
TabWidget tabwidget=tabs.getTabWidget();
|
||||
for(int i=0;i<tabwidget.getChildCount();i++){
|
||||
TextView tv=(TextView) tabwidget.getChildAt(i).findViewById(android.R.id.title);
|
||||
tv.setTextColor(getColor(R.color.tabs));
|
||||
tv.setTextAppearance(R.style.TabText);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -37,7 +37,7 @@ public class DomainAdapter extends RecyclerView.Adapter<DomainAdapter.ViewHolder
|
|||
|
||||
// references to our domains
|
||||
private Domain[] mDomains = {
|
||||
new Domain("dev-master-mobile", "hifi://dev-mobile-master", 0),
|
||||
new Domain("dev-mobile-master", "hifi://dev-mobile-master", 0),
|
||||
new Domain("dev-mobile", "hifi://dev-mobile", 0),
|
||||
new Domain("dev-welcome", "hifi://dev-welcome", 0),
|
||||
};
|
||||
|
|
10
android/app/src/main/res/drawable/domain_bg.xml
Normal file
10
android/app/src/main/res/drawable/domain_bg.xml
Normal file
|
@ -0,0 +1,10 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:top="1dp" android:left="12dp" android:bottom="6dp" android:right="12dp">
|
||||
<shape android:shape="rectangle">
|
||||
<solid android:color="@color/backgroundDark" />
|
||||
<corners android:radius="4dp"/>
|
||||
</shape>
|
||||
</item>
|
||||
|
||||
</layer-list>
|
9
android/app/src/main/res/drawable/search_bg.xml
Normal file
9
android/app/src/main/res/drawable/search_bg.xml
Normal file
|
@ -0,0 +1,9 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:top="7dp" android:left="12dp" android:bottom="7dp" android:right="12dp">
|
||||
<shape android:shape="rectangle">
|
||||
<solid android:color="@color/backgroundSearch" />
|
||||
<corners android:radius="20dp"/>
|
||||
</shape>
|
||||
</item>
|
||||
</layer-list>
|
7
android/app/src/main/res/font/raleway_bold.xml
Normal file
7
android/app/src/main/res/font/raleway_bold.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=700"
|
||||
app:fontProviderCerts="@array/com_google_android_gms_fonts_certs">
|
||||
</font-family>
|
7
android/app/src/main/res/font/raleway_medium.xml
Normal file
7
android/app/src/main/res/font/raleway_medium.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=500"
|
||||
app:fontProviderCerts="@array/com_google_android_gms_fonts_certs">
|
||||
</font-family>
|
|
@ -25,11 +25,13 @@
|
|||
<TabWidget
|
||||
android:id="@android:id/tabs"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@color/backgroundDark"/>
|
||||
|
||||
<SearchView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"/>
|
||||
android:layout_height="42dp"
|
||||
android:background="@drawable/search_bg"/>
|
||||
<FrameLayout
|
||||
android:id="@android:id/tabcontent"
|
||||
android:layout_width="match_parent"
|
||||
|
|
|
@ -8,23 +8,22 @@
|
|||
android:paddingRight="14dp"
|
||||
android:paddingTop="4dp"
|
||||
android:paddingBottom="4dp"
|
||||
android:background="@color/backgroundLight">
|
||||
android:background="@drawable/domain_bg">
|
||||
<ImageView
|
||||
android:id="@+id/domainThumbnail"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/backgroundDark"
|
||||
app:srcCompat="@android:drawable/ic_menu_gallery" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/domainName"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="10dp"
|
||||
android:layout_marginLeft="12dp"
|
||||
android:layout_marginBottom="14dp"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:fontFamily="@font/raleway_semibold"
|
||||
android:text=""
|
||||
android:textSize="20sp"
|
||||
android:textSize="21sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent" />
|
||||
|
||||
|
@ -32,11 +31,11 @@
|
|||
android:id="@+id/amountOfPeople"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="16dp"
|
||||
android:layout_marginLeft="7dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:fontFamily="@font/raleway"
|
||||
android:text="0"
|
||||
android:textSize="18sp"
|
||||
android:text="10"
|
||||
android:textSize="16sp"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
|
@ -44,10 +43,9 @@
|
|||
android:id="@+id/imageView2"
|
||||
android:layout_width="12dp"
|
||||
android:layout_height="13dp"
|
||||
android:layout_marginStart="2dp"
|
||||
android:layout_marginTop="4dp"
|
||||
android:layout_marginLeft="4dp"
|
||||
android:layout_marginBottom="3dp"
|
||||
app:srcCompat="@drawable/ic_person"
|
||||
app:layout_constraintTop_toTopOf="@id/amountOfPeople"
|
||||
app:layout_constraintBottom_toBottomOf="@id/amountOfPeople"
|
||||
app:layout_constraintLeft_toRightOf="@id/amountOfPeople"/>
|
||||
|
||||
|
@ -61,13 +59,13 @@
|
|||
app:layout_constraintRight_toRightOf="parent"
|
||||
android:padding="1dp"
|
||||
android:layout_marginRight="10dp"
|
||||
android:layout_marginTop="15dp"/>
|
||||
android:layout_marginTop="12dp"/>
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/imageViewShare"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="6dp"
|
||||
android:layout_marginTop="9dp"
|
||||
app:layout_constraintTop_toBottomOf="@id/imageButtonBookmark"
|
||||
app:layout_constraintLeft_toLeftOf="@id/imageButtonBookmark"
|
||||
app:layout_constraintRight_toRightOf="@id/imageButtonBookmark"
|
||||
|
|
|
@ -2,9 +2,10 @@
|
|||
<resources>
|
||||
<color name="white_opaque">#ffffff</color>
|
||||
<color name="colorPrimary">#272727</color>
|
||||
<color name="colorPrimaryDark">#303F9F</color>
|
||||
<color name="colorPrimaryDark">#000000</color>
|
||||
<color name="colorAccent">#54D7FD</color>
|
||||
<color name="tabs">#1EB5EC</color>
|
||||
<color name="backgroundDark">#333333</color>
|
||||
<color name="backgroundLight">#4F4F4F</color>
|
||||
<color name="backgroundSearch">#33999999</color>
|
||||
</resources>
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<array name="preloaded_fonts" translatable="false">
|
||||
<item>@font/raleway_bold</item>
|
||||
<item>@font/raleway_medium</item>
|
||||
<item>@font/raleway_semibold</item>
|
||||
</array>
|
||||
</resources>
|
||||
|
|
|
@ -15,6 +15,24 @@
|
|||
|
||||
<style name="AppTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar" />
|
||||
|
||||
<!-- Customizing GoTo ActionBar -->
|
||||
<style name="GotoActionBarTitleStyle"
|
||||
parent="@android:style/TextAppearance.Material.Widget.ActionBar.Title">
|
||||
<item name="android:textSize">18dp</item>
|
||||
<item name="android:paddingLeft">0dp</item>
|
||||
<item name="android:fontFamily">@font/raleway_bold</item>
|
||||
<item name="android:layout_marginLeft">0dp</item>
|
||||
</style>
|
||||
|
||||
<style name="TabText">
|
||||
<item name="android:fontFamily">@font/raleway_medium</item>
|
||||
<item name="android:textSize">12sp</item>
|
||||
<item name="android:textColor">@color/tabs</item>
|
||||
<item name="android:height">30dp</item>
|
||||
<item name="android:layout_margin">0dp</item>
|
||||
<item name="android:padding">0dp</item>
|
||||
</style>
|
||||
|
||||
<!-- Overriding text size so it's not so big in portrait -->
|
||||
<style name="ActionBarTitleStyle"
|
||||
parent="@android:style/TextAppearance.Material.Widget.ActionBar.Title">
|
||||
|
|
|
@ -47,6 +47,7 @@ function init() {
|
|||
raiseBottomBar();
|
||||
|
||||
GlobalServices.connected.connect(handleLogin);
|
||||
GlobalServices.myUsernameChanged.connect(onUsernameChanged);
|
||||
GlobalServices.disconnected.connect(handleLogout);
|
||||
}
|
||||
|
||||
|
@ -240,15 +241,17 @@ function processedNewAvatar(url, modelName) {
|
|||
}
|
||||
|
||||
function handleLogin() {
|
||||
Script.setTimeout(function() {
|
||||
if (Account.isLoggedIn()) {
|
||||
MyAvatar.displayName=Account.getUsername();
|
||||
}
|
||||
}, 2000);
|
||||
if (loginBtn) {
|
||||
loginBtn.editProperties({text: "LOG OUT"});
|
||||
}
|
||||
}
|
||||
|
||||
function onUsernameChanged(username) {
|
||||
if (Account.isLoggedIn()) {
|
||||
MyAvatar.displayName=username;
|
||||
}
|
||||
}
|
||||
|
||||
function handleLogout() {
|
||||
MyAvatar.displayName="";
|
||||
if (loginBtn) {
|
||||
|
@ -257,9 +260,10 @@ function handleLogout() {
|
|||
}
|
||||
|
||||
Script.scriptEnding.connect(function () {
|
||||
shutdown();
|
||||
shutdown();
|
||||
GlobalServices.connected.disconnect(handleLogin);
|
||||
GlobalServices.disconnected.disconnect(handleLogout);
|
||||
GlobalServices.myUsernameChanged.disconnect(onUsernameChanged);
|
||||
});
|
||||
|
||||
init();
|
||||
|
|
Loading…
Reference in a new issue