Permalink
Browse files

Add roboto font, also add some minor changes

  • Loading branch information...
1 parent 03d3e8b commit c9e025a4cd0eeb4a7c26867ed01104fff65871f1 @codestream committed Feb 16, 2014
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -2,6 +2,10 @@
import android.app.Application;
+import com.scrumboard.models.modules.NavigationDrawerItem;
+import com.scrumboard.ui.adapter.NavigationDrawerAdapter;
+import com.scrumboard.util.Injector;
+
/**
* Created by 1 on 15.02.14.
*/
@@ -19,5 +23,12 @@
@Override
public void onCreate() {
super.onCreate();
+
+ Object[] modules = new Object[]{
+ new NavigationDrawerItem(),
+ new NavigationDrawerAdapter()
+ };
+
+ Injector.inject(modules);
}
}
@@ -0,0 +1,47 @@
+package com.scrumboard.ui.adapter;
+
+import android.content.Context;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.BaseAdapter;
+
+import com.scrumboard.MainActivity;
+import com.scrumboard.models.modules.NavigationDrawerItem;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import dagger.Module;
+
+@Module(injects = MainActivity.class, complete = false, library = true)
+public class NavigationDrawerAdapter extends BaseAdapter {
+ private Context mApplicationContext;
+ private List<NavigationDrawerItem> mNavigationDrawerItems;
+
+ public NavigationDrawerAdapter(){}
+
+ public NavigationDrawerAdapter(Context context, ArrayList<NavigationDrawerItem> items){
+ this.mApplicationContext = context;
+ this.mNavigationDrawerItems = items;
+ }
+
+ @Override
+ public int getCount() {
+ return mNavigationDrawerItems.size();
+ }
+
+ @Override
+ public Object getItem(int position) {
+ return mNavigationDrawerItems.get(position);
+ }
+
+ @Override
+ public long getItemId(int position) {
+ return position;
+ }
+
+ @Override
+ public View getView(int position, View convertView, ViewGroup parent) {
+ return null;
+ }
+}
@@ -0,0 +1,26 @@
+package com.scrumboard.ui.widget;
+
+import android.content.Context;
+import android.graphics.Typeface;
+import android.util.AttributeSet;
+import android.widget.TextView;
+
+public class RobotoTextView extends TextView {
+ private Typeface mTypeface;
+
+ public RobotoTextView(Context context) {
+ super(context);
+ }
+
+ public RobotoTextView(Context context, AttributeSet attrs) {
+ super(context, attrs);
+ }
+
+ public RobotoTextView(Context context, AttributeSet attrs, int defStyle) {
+ super(context, attrs, defStyle);
+ if (mTypeface == null) {
+ mTypeface = Typeface.createFromAsset(context.getAssets(), "Roboto-Regular.ttf");
+ }
+ setTypeface(mTypeface);
+ }
+}
@@ -0,0 +1,28 @@
+package com.scrumboard.util;
+
+import dagger.ObjectGraph;
+
+public final class Injector {
+ private static ObjectGraph mObjectGraph = null;
+
+ public static void init(final Object... modules) {
+
+ if(mObjectGraph == null){
+ mObjectGraph = ObjectGraph.create(modules);
+ }
+ else{
+ mObjectGraph = mObjectGraph.plus(modules);
+ }
+
+ // Inject statics
+ mObjectGraph.injectStatics();
+ }
+
+ public static void inject(final Object target){
+ mObjectGraph.inject(target);
+ }
+
+ public static <T> T resolve(Class<T> type){
+ return mObjectGraph.get(type);
+ }
+}

0 comments on commit c9e025a

Please sign in to comment.