Skip to content

Commit b967387

Browse files
committed
Add TechStacks theme and polish
1 parent 255605c commit b967387

File tree

23 files changed

+66
-16
lines changed

23 files changed

+66
-16
lines changed

src/AndroidClient/techstacks/src/main/AndroidManifest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
<application
66
android:allowBackup="true"
7-
android:icon="@mipmap/ic_launcher"
7+
android:icon="@mipmap/logo_transparent"
88
android:label="@string/app_name"
99
android:theme="@style/AppTheme" >
1010
<activity

src/AndroidClient/techstacks/src/main/java/servicestack/net/techstacks/MainActivity.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
package servicestack.net.techstacks;
22

3+
import android.graphics.Color;
4+
import android.graphics.drawable.ColorDrawable;
35
import android.os.Bundle;
46
import android.support.v4.app.Fragment;
57
import android.support.v4.app.FragmentManager;
@@ -19,6 +21,7 @@
1921
import android.widget.ArrayAdapter;
2022
import android.widget.EditText;
2123
import android.widget.ListView;
24+
import android.widget.RelativeLayout;
2225
import android.widget.Spinner;
2326

2427
import com.android.internal.util.Predicate;
@@ -59,8 +62,12 @@ protected void onCreate(Bundle savedInstanceState) {
5962
// Set up the action bar.
6063
final ActionBar actionBar = getSupportActionBar();
6164
actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
65+
actionBar.setDisplayOptions(ActionBar.DISPLAY_SHOW_HOME | ActionBar.DISPLAY_SHOW_TITLE);
66+
actionBar.setBackgroundDrawable(getResources().getDrawable(R.color.actionbar_background));
67+
actionBar.setStackedBackgroundDrawable(getResources().getDrawable(R.color.tab_background));
68+
actionBar.setIcon(R.drawable.ic_actionbar);
6269

63-
// Create the adapter that will return a fragment for each of the three
70+
// Create the adapter that will return a fragment for each of the three
6471
// primary sections of the activity.
6572
mSectionsPagerAdapter = new SectionsPagerAdapter(getSupportFragmentManager());
6673

src/AndroidClient/techstacks/src/main/java/servicestack/net/techstacks/TechStackActivity.java

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -109,23 +109,25 @@ private void renderCategories(TechStackDetails result) {
109109
if (results.size() == 0)
110110
continue;
111111

112-
LinearLayout layoutCategories = new LinearLayout(this);
113-
layoutCategories.setOrientation(LinearLayout.HORIZONTAL);
114-
115112
TextView lblCategory = new TextView(this);
116113
lblCategory.setText(o.getTitle());
117114
lblCategory.setPadding(0, 20, 0, 0);
118115
layout.addView(lblCategory,
119-
new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.MATCH_PARENT));
116+
new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.MATCH_PARENT));
117+
118+
LinearLayout layoutCategories = null;
120119

121120
final Activity activity = this;
122-
for (final TechnologyInStack x : results){
121+
for (int i = 0; i < results.size(); i++) {
122+
final TechnologyInStack x = results.get(i);
123+
123124
final ImageView img = new ImageView(this);
124125
img.setMaxHeight(120);
125126
img.setAdjustViewBounds(true);
126-
img.setPadding(20, 0, 0, 20);
127+
img.setPadding(30, 10, 0, 30);
127128
img.setOnClickListener(new View.OnClickListener() {
128-
@Override public void onClick(View v) {
129+
@Override
130+
public void onClick(View v) {
129131
App.openTechnology(activity, x.getSlug());
130132
}
131133
});
@@ -135,12 +137,19 @@ public void success(Bitmap response) {
135137
img.setImageBitmap(response);
136138
}
137139
});
140+
141+
if (i % 3 == 0){
142+
layoutCategories = new LinearLayout(this);
143+
layoutCategories.setOrientation(LinearLayout.HORIZONTAL);
144+
layout.addView(layoutCategories,
145+
new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.MATCH_PARENT));
146+
}
147+
138148
layoutCategories.addView(img,
139-
new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT));
149+
new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT));
140150
}
141151

142-
layout.addView(layoutCategories,
143-
new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.MATCH_PARENT));
152+
144153
}
145154
}
146155

src/AndroidClient/techstacks/src/main/java/servicestack/net/techstacks/TechnologyActivity.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@ protected void onCreate(Bundle savedInstanceState) {
4242
ImageView img = (ImageView) findViewById(R.id.imgTechnologyLogo);
4343
img.setImageBitmap(null);
4444

45+
ListView list = (ListView) findViewById(R.id.listTechnologyTechStacks);
46+
list.setAdapter(null);
47+
4548
TextView txtUrl = (TextView)findViewById(R.id.lblTechnologyVendorUrl);
4649
final Activity activity = this;
4750
txtUrl.setOnClickListener(new View.OnClickListener() {
Binary file not shown.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<selector xmlns:android="http://schemas.android.com/apk/res/android">
3+
<item android:state_focused="false" android:state_selected="false"
4+
android:state_pressed="false" android:drawable="@color/tab_background"/>
5+
<item android:state_focused="false" android:state_selected="true"
6+
android:state_pressed="false" android:drawable="@drawable/tab_bar_background_selected"/>
7+
<item android:state_selected="false" android:state_pressed="true"
8+
android:drawable="@color/tab_background"/>
9+
<item android:state_selected="true" android:state_pressed="true"
10+
android:drawable="@color/tab_background"/>
11+
</selector>

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy