Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public class DownloadManagerImpl implements DownloadManager

private Context mContext;
private String mLocation;
protected ArrayList<DownloadMission> mMissions = new ArrayList<DownloadMission>();
private ArrayList<DownloadMission> mMissions = new ArrayList<DownloadMission>();

public DownloadManagerImpl(Context context, String location) {
mContext = context;
Expand Down
6 changes: 3 additions & 3 deletions app/src/main/java/us/shandian/giga/get/DownloadMission.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ public static interface MissionListener {
public long length = 0;
public long done = 0;
public int threadCount = 3;
public int finishCount = 0;
public ArrayList<Long> threadPositions = new ArrayList<Long>();
public HashMap<Long, Boolean> blockState = new HashMap<Long, Boolean>();
private int finishCount = 0;
private ArrayList<Long> threadPositions = new ArrayList<Long>();
private HashMap<Long, Boolean> blockState = new HashMap<Long, Boolean>();
public boolean running = false;
public boolean finished = false;
public boolean fallback = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

import static us.shandian.giga.BuildConfig.DEBUG;

public class DownloadRunnable implements Runnable
class DownloadRunnable implements Runnable
{
private static final String TAG = DownloadRunnable.class.getSimpleName();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import java.net.URL;

// Single-threaded fallback mode
public class DownloadRunnableFallback implements Runnable
class DownloadRunnableFallback implements Runnable
{
private DownloadMission mMission;
//private int mId;
Expand Down
143 changes: 70 additions & 73 deletions app/src/main/java/us/shandian/giga/ui/adapter/NavigationAdapter.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,78 +11,75 @@
import us.shandian.giga.R;
import us.shandian.giga.util.Utility;

public class NavigationAdapter extends BaseAdapter
{
private Context mContext;
private LayoutInflater mInflater;
private String[] mStrs;
private int[] mIcons;

public NavigationAdapter(Context context, int strs, int icons) {
mContext = context;
mInflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
mStrs = context.getResources().getStringArray(strs);

String[] iconStr = context.getResources().getStringArray(icons);
mIcons = new int[iconStr.length];

for (int i = 0; i < iconStr.length; i++) {
String str = iconStr[i];
if (!str.equals("null")) {
mIcons[i] = context.getResources().getIdentifier(str, "drawable", "us.shandian.giga");
}
}
}

@Override
public int getCount() {
return mStrs.length;
}

@Override
public Object getItem(int i) {
return mStrs[i];
}

@Override
public long getItemId(int i) {
return i;
}

@Override
public View getView(int position, View convertView, ViewGroup parent) {
if (position >= getCount()) {
return null;
} else {
String str = mStrs[position];
View v = convertView;

if (str.equals("-")) {
v = mInflater.inflate(R.layout.drawer_divider, parent, false);
v.setTag(1);
return v;
} else {

if (v == null || ((Integer)v.getTag()) == 1) {
v = mInflater.inflate(R.layout.drawer_item, parent, false);
v.setTag(0);
}

ImageView iv = Utility.findViewById(v, R.id.drawer_icon);
TextView tv = Utility.findViewById(v, R.id.drawer_text);

if (iv != null && tv != null) {

iv.setImageDrawable(mContext.getResources().getDrawable(mIcons[position]));
tv.setText(str);
tv.getPaint().setFakeBoldText(true);

}

return v;

}
}
}
public class NavigationAdapter extends BaseAdapter {
private Context mContext;
private LayoutInflater mInflater;
private String[] mStrs;
private int[] mIcons;

public NavigationAdapter(Context context, int strs, int icons) {
mContext = context;
mInflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
mStrs = context.getResources().getStringArray(strs);

String[] iconStr = context.getResources().getStringArray(icons);
mIcons = new int[iconStr.length];

for (int i = 0; i < iconStr.length; i++) {
String str = iconStr[i];
if (!str.equals("null")) {
mIcons[i] = context.getResources().getIdentifier(str, "drawable", "us.shandian.giga");
}
}
}

@Override
public int getCount() {
return mStrs.length;
}

@Override
public Object getItem(int i) {
return mStrs[i];
}

@Override
public long getItemId(int i) {
return i;
}

@Override
public View getView(int position, View convertView, ViewGroup parent) {
if (position >= getCount()) {
return null;
} else {
String str = mStrs[position];
View v = convertView;
if (str.equals("-")) {
v = mInflater.inflate(R.layout.drawer_divider, parent, false);
v.setTag(1);
return v;
} else {

if (v == null || ((Integer) v.getTag()) == 1) {
v = mInflater.inflate(R.layout.drawer_item, parent, false);
v.setTag(0);
}

ImageView iv = Utility.findViewById(v, R.id.drawer_icon);
TextView tv = Utility.findViewById(v, R.id.drawer_text);

if (iv != null && tv != null ) {
iv.setImageDrawable(mContext.getResources().getDrawable(mIcons[position]));
tv.setText(str);
tv.getPaint().setFakeBoldText(true);

}

return v;

}
}
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -24,31 +24,31 @@
*/
public class FloatingActionButton extends View implements Animator.AnimatorListener {

final static OvershootInterpolator overshootInterpolator = new OvershootInterpolator();
final static AccelerateInterpolator accelerateInterpolator = new AccelerateInterpolator();
private final static OvershootInterpolator overshootInterpolator = new OvershootInterpolator();
private final static AccelerateInterpolator accelerateInterpolator = new AccelerateInterpolator();

Context context;
Paint mButtonPaint;
Paint mDrawablePaint;
Bitmap mBitmap;
boolean mHidden = false;
private Context context;
private Paint mButtonPaint;
private Paint mDrawablePaint;
private Bitmap mBitmap;
private boolean mHidden = false;

public FloatingActionButton(Context context) {
super(context);
this.context = context;
init(Color.WHITE);
}

public void setFloatingActionButtonColor(int FloatingActionButtonColor) {
private void setFloatingActionButtonColor(int FloatingActionButtonColor) {
init(FloatingActionButtonColor);
}

public void setFloatingActionButtonDrawable(Drawable FloatingActionButtonDrawable) {
private void setFloatingActionButtonDrawable(Drawable FloatingActionButtonDrawable) {
mBitmap = ((BitmapDrawable) FloatingActionButtonDrawable).getBitmap();
invalidate();
}

public void init(int FloatingActionButtonColor) {
private void init(int FloatingActionButtonColor) {
setWillNotDraw(false);
setLayerType(View.LAYER_TYPE_SOFTWARE, null);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public ProgressDrawable(Context context, int background, int foreground) {
this(context.getResources().getColor(background), context.getResources().getColor(foreground));
}

public ProgressDrawable(int background, int foreground) {
private ProgressDrawable(int background, int foreground) {
mBackgroundColor = background;
mForegroundColor = foreground;
}
Expand Down
Loading