Created
April 4, 2017 17:51
-
-
Save Dampas/b20cc3475192d44a1fe41beac61034f0 to your computer and use it in GitHub Desktop.
Project - Single Screen App
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:app="http://schemas.android.com/apk/res-auto" | |
xmlns:tools="http://schemas.android.com/tools" | |
android:id="@+id/activity_main" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
android:paddingBottom="0px" | |
android:paddingLeft="0px" | |
android:paddingRight="0px" | |
android:paddingTop="0px" | |
tools:context="com.example.android.apartmentapp.MainActivity"> | |
<LinearLayout | |
android:layout_width="match_parent" | |
android:layout_height="wrap_content" | |
android:background="@color/topBarColor" | |
android:orientation="vertical"> | |
<LinearLayout | |
android:layout_width="wrap_content" | |
android:layout_height="wrap_content" | |
android:layout_gravity="center_horizontal" | |
android:layout_margin="@dimen/activity_horizontal_margin" | |
android:background="@color/backgroundColor" | |
android:orientation="horizontal"> | |
<TextView | |
android:id="@+id/textView" | |
android:layout_width="wrap_content" | |
android:layout_height="match_parent" | |
android:layout_marginEnd="1px" | |
android:layout_marginRight="1px" | |
android:background="@color/topBarColor" | |
android:gravity="center_vertical" | |
android:paddingEnd="@dimen/activity_horizontal_margin" | |
android:paddingRight="@dimen/activity_horizontal_margin" | |
android:text="@string/_phone_number" | |
android:textColor="@color/backgroundColor" | |
android:textSize="12sp" /> | |
<TextView | |
android:id="@+id/font_awesome_email" | |
android:layout_width="wrap_content" | |
android:layout_height="wrap_content" | |
android:background="@color/topBarColor" | |
android:paddingLeft="@dimen/activity_horizontal_margin" | |
android:paddingStart="@dimen/activity_horizontal_margin" | |
android:text="@string/font_awesome_email" | |
android:textColor="@color/backgroundColor" | |
android:textSize="18sp" /> | |
</LinearLayout> | |
<ImageView | |
android:id="@+id/imageView2" | |
android:layout_width="match_parent" | |
android:layout_height="250dp" | |
android:layout_margin="0dp" | |
android:contentDescription="@string/apartment_image" | |
android:padding="0dp" | |
android:scaleType="centerCrop" | |
app:srcCompat="@drawable/apartmentlanistezagreb" /> | |
<HorizontalScrollView | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
android:background="@color/menuColor"> | |
<LinearLayout | |
android:layout_width="wrap_content" | |
android:layout_height="wrap_content" | |
android:background="@color/colorPrimary" | |
android:orientation="horizontal"> | |
<Button | |
android:layout_width="wrap_content" | |
android:layout_height="wrap_content" | |
android:layout_gravity="center_horizontal" | |
android:layout_marginEnd="@dimen/activity_one_point_margin" | |
android:layout_marginRight="@dimen/activity_one_point_margin" | |
android:background="@color/menuColor" | |
android:padding="@dimen/activity_horizontal_margin" | |
android:text="@string/home" | |
android:textColor="@color/colorPrimary" /> | |
<Button | |
android:layout_width="wrap_content" | |
android:layout_height="wrap_content" | |
android:layout_gravity="center_horizontal" | |
android:layout_marginEnd="@dimen/activity_one_point_margin" | |
android:layout_marginRight="@dimen/activity_one_point_margin" | |
android:background="@color/menuColor" | |
android:padding="@dimen/activity_horizontal_margin" | |
android:text="@string/reviews" | |
android:textColor="@color/colorPrimary" /> | |
<Button | |
android:layout_width="wrap_content" | |
android:layout_height="wrap_content" | |
android:layout_gravity="center_horizontal" | |
android:layout_marginEnd="@dimen/activity_one_point_margin" | |
android:layout_marginRight="@dimen/activity_one_point_margin" | |
android:background="@color/menuColor" | |
android:padding="@dimen/activity_horizontal_margin" | |
android:text="@string/about_zagreb" | |
android:textColor="@color/colorPrimary" /> | |
<Button | |
android:layout_width="wrap_content" | |
android:layout_height="wrap_content" | |
android:layout_gravity="center_horizontal" | |
android:layout_marginEnd="@dimen/activity_one_point_margin" | |
android:layout_marginRight="@dimen/activity_one_point_margin" | |
android:background="@color/menuColor" | |
android:padding="@dimen/activity_horizontal_margin" | |
android:text="@string/contacts" | |
android:textColor="@color/colorPrimary" /> | |
</LinearLayout> | |
</HorizontalScrollView> | |
<LinearLayout | |
android:layout_width="match_parent" | |
android:layout_height="wrap_content" | |
android:background="@color/backgroundColor" | |
android:orientation="vertical"> | |
<ImageView | |
android:id="@+id/imageView" | |
android:layout_width="match_parent" | |
android:layout_height="12dp" | |
android:contentDescription="@string/shaddow" | |
android:scaleType="fitXY" | |
app:srcCompat="@drawable/bottomshadow" /> | |
<TextView | |
android:id="@+id/textView2" | |
android:layout_width="match_parent" | |
android:layout_height="wrap_content" | |
android:layout_margin="@dimen/activity_horizontal_margin" | |
android:gravity="center" | |
android:text="@string/_title" | |
android:textAppearance="@style/Title" /> | |
<TextView | |
android:id="@+id/textView3" | |
android:layout_width="wrap_content" | |
android:layout_height="wrap_content" | |
android:layout_gravity="center_horizontal" | |
android:text="@string/_subtitle" | |
android:textSize="18sp" /> | |
<LinearLayout | |
android:layout_width="match_parent" | |
android:layout_height="wrap_content" | |
android:layout_marginBottom="@dimen/activity_double_vertical_margin" | |
android:layout_marginTop="@dimen/activity_double_vertical_margin" | |
android:baselineAligned="false" | |
android:orientation="horizontal"> | |
<LinearLayout | |
android:layout_width="wrap_content" | |
android:layout_height="wrap_content" | |
android:layout_weight="1" | |
android:orientation="vertical"> | |
<TextView | |
android:id="@+id/font_awesome_house" | |
android:layout_width="match_parent" | |
android:layout_height="wrap_content" | |
android:gravity="center_horizontal" | |
android:text="@string/font_awesome_house" | |
android:textAppearance="@style/TopIcons" /> | |
<TextView | |
android:layout_width="match_parent" | |
android:layout_height="wrap_content" | |
android:gravity="center" | |
android:text="@string/entire_nhome_apt" | |
android:textAppearance="@style/TopIconsText" /> | |
</LinearLayout> | |
<LinearLayout | |
android:layout_width="wrap_content" | |
android:layout_height="wrap_content" | |
android:layout_weight="1" | |
android:orientation="vertical"> | |
<TextView | |
android:id="@+id/font_awesome_guests" | |
android:layout_width="match_parent" | |
android:layout_height="wrap_content" | |
android:gravity="center_horizontal" | |
android:text="@string/font_awesome_guests" | |
android:textAppearance="@style/TopIcons" /> | |
<TextView | |
android:layout_width="match_parent" | |
android:layout_height="wrap_content" | |
android:gravity="center" | |
android:text="@string/_6_guests" | |
android:textAppearance="@style/TopIconsText" /> | |
</LinearLayout> | |
<LinearLayout | |
android:layout_width="wrap_content" | |
android:layout_height="wrap_content" | |
android:layout_weight="1" | |
android:orientation="vertical"> | |
<TextView | |
android:id="@+id/font_awesome_bedroom" | |
android:layout_width="match_parent" | |
android:layout_height="wrap_content" | |
android:gravity="center_horizontal" | |
android:text="@string/font_awesome_bedroom" | |
android:textAppearance="@style/TopIcons" /> | |
<TextView | |
android:layout_width="match_parent" | |
android:layout_height="wrap_content" | |
android:gravity="center" | |
android:text="@string/_2_bedrooms" | |
android:textAppearance="@style/TopIconsText" /> | |
</LinearLayout> | |
</LinearLayout> | |
<LinearLayout | |
android:layout_width="match_parent" | |
android:layout_height="wrap_content" | |
android:layout_marginBottom="@dimen/activity_vertical_margin" | |
android:layout_marginTop="@dimen/activity_double_vertical_margin" | |
android:baselineAligned="false" | |
android:orientation="horizontal"> | |
<LinearLayout | |
android:layout_width="wrap_content" | |
android:layout_height="wrap_content" | |
android:layout_weight="1" | |
android:orientation="vertical"> | |
<TextView | |
android:id="@+id/font_awesome_beds" | |
android:layout_width="match_parent" | |
android:layout_height="wrap_content" | |
android:gravity="center_horizontal" | |
android:text="@string/font_awesome_beds" | |
android:textAppearance="@style/TopIcons" /> | |
<TextView | |
android:layout_width="match_parent" | |
android:layout_height="wrap_content" | |
android:gravity="center" | |
android:text="@string/_4_beds" | |
android:textAppearance="@style/TopIconsText" /> | |
</LinearLayout> | |
<LinearLayout | |
android:layout_width="wrap_content" | |
android:layout_height="wrap_content" | |
android:layout_weight="1" | |
android:orientation="vertical"> | |
<TextView | |
android:id="@+id/font_awesome_kitchen" | |
android:layout_width="match_parent" | |
android:layout_height="wrap_content" | |
android:gravity="center_horizontal" | |
android:text="@string/font_awesome_kitchen" | |
android:textAppearance="@style/TopIcons" /> | |
<TextView | |
android:layout_width="match_parent" | |
android:layout_height="wrap_content" | |
android:gravity="center" | |
android:text="@string/fully_nequipped_nkitchen" | |
android:textAppearance="@style/TopIconsText" /> | |
</LinearLayout> | |
<LinearLayout | |
android:layout_width="wrap_content" | |
android:layout_height="wrap_content" | |
android:layout_weight="1" | |
android:orientation="vertical"> | |
<TextView | |
android:id="@+id/font_awesome_wifi" | |
android:layout_width="match_parent" | |
android:layout_height="wrap_content" | |
android:gravity="center_horizontal" | |
android:text="@string/font_awesome_wifi" | |
android:textAppearance="@style/TopIcons" /> | |
<TextView | |
android:layout_width="match_parent" | |
android:layout_height="wrap_content" | |
android:gravity="center" | |
android:text="@string/high_speed_nwifi" | |
android:textAppearance="@style/TopIconsText" /> | |
</LinearLayout> | |
</LinearLayout> | |
<TextView | |
android:layout_width="match_parent" | |
android:layout_height="wrap_content" | |
android:layout_marginTop="@dimen/activity_horizontal_margin" | |
android:gravity="center" | |
android:text="@string/about_our_apartment" | |
android:textAppearance="@style/SubTitle" /> | |
<TextView | |
android:id="@+id/textView4" | |
android:layout_width="match_parent" | |
android:layout_height="wrap_content" | |
android:layout_margin="@dimen/activity_horizontal_margin" | |
android:text="@string/about_apt_text" | |
android:textAppearance="@style/TextDescription" /> | |
<LinearLayout | |
android:layout_width="match_parent" | |
android:layout_height="wrap_content" | |
android:layout_marginBottom="@dimen/activity_double_vertical_margin" | |
android:layout_marginTop="@dimen/activity_double_vertical_margin" | |
android:background="@color/colorPrimary" | |
android:orientation="vertical"> | |
<LinearLayout | |
android:layout_width="match_parent" | |
android:layout_height="wrap_content" | |
android:layout_marginTop="1px"> | |
<ImageView | |
android:layout_width="wrap_content" | |
android:layout_height="wrap_content" | |
android:background="@color/backgroundColor" | |
android:padding="@dimen/activity_horizontal_margin" | |
android:src="@drawable/ic_home_black_32dp" | |
android:tint="@color/colorPrimary" /> | |
<TextView | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
android:background="@color/backgroundColor" | |
android:gravity="center_vertical" | |
android:padding="@dimen/activity_horizontal_margin" | |
android:paddingLeft="0dp" | |
android:paddingStart="0dp" | |
android:text="@string/apartment_damir_amp_ivona" | |
android:textAppearance="@style/AddressInfo" /> | |
</LinearLayout> | |
<LinearLayout | |
android:layout_width="match_parent" | |
android:layout_height="wrap_content" | |
android:layout_marginTop="1px"> | |
<ImageView | |
android:layout_width="wrap_content" | |
android:layout_height="wrap_content" | |
android:background="@color/backgroundColor" | |
android:padding="@dimen/activity_horizontal_margin" | |
android:src="@drawable/ic_location_on_black_32dp" | |
android:tint="@color/colorPrimary" /> | |
<TextView | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
android:background="@color/backgroundColor" | |
android:gravity="center_vertical" | |
android:padding="@dimen/activity_horizontal_margin" | |
android:paddingLeft="0dp" | |
android:paddingStart="0dp" | |
android:text="@string/address" | |
android:textAppearance="@style/AddressInfo" /> | |
</LinearLayout> | |
<LinearLayout | |
android:layout_width="match_parent" | |
android:layout_height="wrap_content" | |
android:layout_marginTop="1px"> | |
<ImageView | |
android:layout_width="wrap_content" | |
android:layout_height="wrap_content" | |
android:background="@color/backgroundColor" | |
android:padding="@dimen/activity_horizontal_margin" | |
android:src="@drawable/ic_phone_android_black_32dp" | |
android:tint="@color/colorPrimary" /> | |
<TextView | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
android:background="@color/backgroundColor" | |
android:gravity="center_vertical" | |
android:padding="@dimen/activity_horizontal_margin" | |
android:paddingLeft="0dp" | |
android:paddingStart="0dp" | |
android:text="@string/_phone_number" | |
android:textAppearance="@style/AddressInfo" /> | |
</LinearLayout> | |
<LinearLayout | |
android:layout_width="match_parent" | |
android:layout_height="wrap_content" | |
android:layout_marginTop="1px"> | |
<ImageView | |
android:layout_width="wrap_content" | |
android:layout_height="wrap_content" | |
android:background="@color/backgroundColor" | |
android:padding="@dimen/activity_horizontal_margin" | |
android:src="@drawable/ic_email_black_32dp" | |
android:tint="@color/colorPrimary" /> | |
<TextView | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
android:background="@color/backgroundColor" | |
android:gravity="center_vertical" | |
android:padding="@dimen/activity_horizontal_margin" | |
android:paddingLeft="0dp" | |
android:paddingStart="0dp" | |
android:text="@string/email" | |
android:textAppearance="@style/AddressInfo" /> | |
</LinearLayout> | |
</LinearLayout> | |
<!-- Linear layout main container --> | |
</LinearLayout> | |
</LinearLayout> | |
</ScrollView> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<resources> | |
<color name="colorPrimary">#2D6771</color> | |
<color name="colorPrimaryDark">#303F9F</color> | |
<color name="colorAccent">#f19185</color> | |
<color name="colorText">#4f5152</color> | |
<color name="menuColor">#F9F9F9</color> | |
<color name="backgroundColor">#FFF</color> | |
<color name="topBarColor">#23282D</color> | |
</resources> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<resources> | |
<!-- Default screen margins, per the Android Design guidelines. --> | |
<dimen name="activity_horizontal_margin">16dp</dimen> | |
<dimen name="activity_double_horizontal_margin">32dp</dimen> | |
<dimen name="activity_vertical_margin">16dp</dimen> | |
<dimen name="activity_double_vertical_margin">16dp</dimen> | |
<dimen name="activity_one_point_margin">1dp</dimen> | |
<dimen name="activity_two_point_margin">2dp</dimen> | |
</resources> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.example.android.apartmentapp; | |
import android.graphics.Typeface; | |
import android.os.Bundle; | |
import android.support.v7.app.AppCompatActivity; | |
import android.widget.TextView; | |
public class MainActivity extends AppCompatActivity { | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.activity_main); | |
Typeface fontAwesomeFont = Typeface.createFromAsset(getAssets(), "airglyphs.ttf"); | |
TextView fontAwesomeHouse = (TextView) findViewById(R.id.font_awesome_house); | |
TextView fontAwesomeBedroom = (TextView) findViewById(R.id.font_awesome_bedroom); | |
TextView fontAwesomeGuests = (TextView) findViewById(R.id.font_awesome_guests); | |
TextView fontAwesomeBeds = (TextView) findViewById(R.id.font_awesome_beds); | |
TextView fontAwesomeKitchen = (TextView) findViewById(R.id.font_awesome_kitchen); | |
TextView fontAwesomeWifi = (TextView) findViewById(R.id.font_awesome_wifi); | |
TextView fontAwesomeEmail = (TextView) findViewById(R.id.font_awesome_email); | |
fontAwesomeHouse.setTypeface(fontAwesomeFont); | |
fontAwesomeBedroom.setTypeface(fontAwesomeFont); | |
fontAwesomeGuests.setTypeface(fontAwesomeFont); | |
fontAwesomeBeds.setTypeface(fontAwesomeFont); | |
fontAwesomeKitchen.setTypeface(fontAwesomeFont); | |
fontAwesomeWifi.setTypeface(fontAwesomeFont); | |
fontAwesomeEmail.setTypeface(fontAwesomeFont); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<resources> | |
<!-- Base application theme. --> | |
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar"> | |
<!-- Customize your theme here. --> | |
<item name="colorPrimary">@color/colorPrimary</item> | |
<item name="colorPrimaryDark">@color/colorPrimaryDark</item> | |
<item name="colorAccent">@color/colorAccent</item> | |
</style> | |
<style name="TopIcons"> | |
<item name="android:textColor">@color/colorPrimary</item> | |
<item name="android:textSize">48sp</item> | |
</style> | |
<style name="Title"> | |
<item name="android:textColor">@color/colorPrimary</item> | |
<item name="android:textSize">36sp</item> | |
<item name="android:textStyle">bold</item> | |
</style> | |
<style name="TopIconsText"> | |
<item name="android:textColor">@color/colorText</item> | |
<item name="android:textStyle">bold</item> | |
<item name="android:textSize">18sp</item> | |
</style> | |
<style name="SubTitle"> | |
<item name="android:textColor">@color/colorAccent</item> | |
<item name="android:textSize">32sp</item> | |
</style> | |
<style name="TextDescription"> | |
<item name="android:textColor">@color/colorText</item> | |
<item name="android:lineSpacingExtra">3dp</item> | |
<item name="android:textSize">18sp</item> | |
</style> | |
<style name="AddressInfo"> | |
<item name="android:textColor">@color/colorText</item> | |
<item name="android:textSize">18sp</item> | |
</style> | |
</resources> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment