Skip to content

Commit 0781bee

Browse files
committed
Style mods
1 parent d2aed5a commit 0781bee

8 files changed

Lines changed: 59 additions & 37 deletions

File tree

build.gradle

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ buildscript {
33
mavenCentral()
44
}
55
dependencies {
6-
classpath 'com.android.tools.build:gradle:0.13.+'
6+
classpath 'com.android.tools.build:gradle:1.0.+'
77
}
88
}
99

@@ -12,7 +12,7 @@ repositories {
1212
}
1313

1414
task wrapper(type: Wrapper) {
15-
gradleVersion = '2.1'
15+
gradleVersion = '2.2'
1616
}
1717

1818
apply plugin: 'com.android.application'
@@ -25,12 +25,12 @@ dependencies {
2525

2626
android {
2727
defaultConfig {
28-
versionCode 21
29-
versionName "2.5.0"
28+
versionCode 22
29+
versionName "2.6.0"
3030
}
3131

3232
compileSdkVersion 21
33-
buildToolsVersion "21.0.2"
33+
buildToolsVersion "21.1.1"
3434

3535
lintOptions {
3636
abortOnError false
@@ -44,8 +44,7 @@ android {
4444
buildTypes {
4545
release {
4646
debuggable false
47-
runProguard false
48-
proguardFile file('proguard.cfg')
47+
minifyEnabled false
4948
}
5049
}
5150

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
#Sun Oct 26 19:24:09 GET 2014
1+
#Mon Dec 08 04:45:09 GET 2014
22
distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=http\://services.gradle.org/distributions/gradle-2.1-all.zip
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-2.2.1-all.zip

res/layout/activity_schedule.xml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,15 @@
55
android:orientation="vertical"
66
android:layout_width="match_parent"
77
android:layout_height="match_parent">
8+
<TextView
9+
android:id="@+id/nothing_found"
10+
android:layout_width="fill_parent"
11+
android:layout_height="wrap_content"
12+
style="@style/BusListText"
13+
android:gravity="center"
14+
android:visibility="gone"
15+
android:text="@string/nothing_found"/>
16+
817
<ListView android:id="@+id/busSchedule"
918
android:layout_width="match_parent"
1019
android:layout_weight="1"

res/layout/bus_info.xml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,36 +3,36 @@
33
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
44
style="@style/BusListItem"
55
android:layout_width="fill_parent"
6-
android:layout_height="fill_parent"
6+
android:layout_height="50dp"
77
android:orientation="horizontal" >
88

99
<TextView android:id="@+id/busNumber"
10-
style="@style/BusListText"
11-
android:gravity="left"
10+
style="@style/BusListText.Number"
11+
android:gravity="center"
1212
android:singleLine="true"
1313
android:layout_width="0dip"
14-
android:layout_height="wrap_content"
15-
android:layout_gravity="center_vertical|left"
14+
android:layout_height="fill_parent"
15+
android:layout_gravity="center_vertical"
1616
android:ellipsize="none"
1717
android:layout_weight="2"/>
1818
<TextView android:id="@+id/busDestination"
19-
style="@style/BusListText"
19+
style="@style/BusListText.Destination"
2020
android:singleLine="true"
2121
android:ellipsize="marquee"
2222
android:marqueeRepeatLimit ="marquee_forever"
2323
android:layout_width="0dip"
24-
android:layout_height="wrap_content"
24+
android:layout_height="fill_parent"
2525
android:scrollHorizontally="true"
2626
android:gravity="center"
27-
android:layout_gravity="center"
27+
android:layout_gravity="center_vertical"
2828
android:layout_weight="5"/>
2929
<TextView android:id="@+id/busArrival"
30-
style="@style/BusListText"
31-
android:gravity="right"
30+
style="@style/BusListText.Arrival"
31+
android:gravity="center"
3232
android:singleLine="true"
3333
android:layout_width="0dip"
34-
android:layout_height="wrap_content"
35-
android:layout_gravity="center_vertical|right"
34+
android:layout_height="fill_parent"
35+
android:layout_gravity="center_vertical"
3636
android:ellipsize="none"
3737
android:layout_weight="2" />
3838

res/values/style_buslist.xml

Lines changed: 0 additions & 10 deletions
This file was deleted.

res/values/styles.xml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<resources>
3+
<style name="BusListItem">
4+
<item name="android:layout_marginBottom">2dp</item>
5+
</style>
6+
<style name="BusListText">
7+
<item name="android:padding">10dp</item>
8+
<item name="android:textSize">16sp</item>
9+
<item name="android:textColor">#2d2d2d</item>
10+
</style>
11+
<style name="BusListText.Number">
12+
<item name="android:background">#f2b707</item>
13+
<item name="android:textColor">#ffffff</item>
14+
<item name="android:textSize">20sp</item>
15+
<item name="android:textStyle">bold</item>
16+
</style>
17+
<style name="BusListText.Arrival">
18+
</style>
19+
<style name="BusListText.Destination">
20+
</style>
21+
</resources>

src/com/tbilisi/bus/ScheduleActivity.java

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22

33
import android.os.AsyncTask;
44
import android.os.Bundle;
5+
import android.os.Handler;
56
import android.support.v7.app.ActionBar;
67
import android.support.v7.app.ActionBarActivity;
78
import android.view.Menu;
89
import android.view.MenuItem;
10+
import android.view.View;
911
import android.widget.ListView;
10-
import java.lang.Runnable;
11-
import android.os.Handler;
1212

1313
import com.google.android.gms.ads.AdRequest;
1414
import com.google.android.gms.ads.AdView;
@@ -156,9 +156,7 @@ protected Void doInBackground(Void... voids) {
156156
} catch (Exception e) {
157157
e.printStackTrace();
158158
}
159-
if(newBusList.size() == 0 && busList.size() == 0)
160-
busList.add(new BusInfo(0, getResources().getString(R.string.nothing_found), 0));
161-
else if(newBusList.size() > 0) {
159+
if(newBusList.size() > 0) {
162160
busList = newBusList;
163161
}
164162
return null;
@@ -167,6 +165,11 @@ else if(newBusList.size() > 0) {
167165
@Override
168166
protected void onPostExecute(Void result) {
169167
adapter.update(busList);
168+
if(busList.size() == 0) {
169+
findViewById(R.id.nothing_found).setVisibility(View.VISIBLE);
170+
} else {
171+
findViewById(R.id.nothing_found).setVisibility(View.GONE);
172+
}
170173
}
171174
}
172175

src/com/tbilisi/bus/util/BusListAdapter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public View getView(int i, View convertView, ViewGroup viewGroup) {
6060
busDestination.setTypeface(A.typeface);
6161
busArrival.setTypeface(A.typeface);
6262

63-
busNumber.setText("№" + String.valueOf(item.number));
63+
busNumber.setText(String.valueOf(item.number));
6464
busDestination.setText(item.destination);
6565
busArrival.setText(String.valueOf(item.arrival) + "წთ");
6666

0 commit comments

Comments
 (0)