Skip to content
This repository was archived by the owner on Mar 7, 2025. It is now read-only.
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
6 changes: 3 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
language: android
jdk: oraclejdk7
jdk: oraclejdk8
sudo: false

android:
components:
- extra-android-m2repository
- extra-android-support
- build-tools-23.0.1
- android-23
- build-tools-27.0.1

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Latest is 27.0.3, if that matters.

- android-27

env:
global:
Expand Down
24 changes: 15 additions & 9 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,19 @@ repositories{
maven {
url 'http://dl.bintray.com/amulyakhare/maven'
}
maven {
url 'https://maven.google.com/'
name 'Google'
}
}

ext.supportLibrariesVersion = '27.0.1'

android {
useLibrary 'org.apache.http.legacy'

compileSdkVersion 23
buildToolsVersion "23.0.1"
compileSdkVersion 27
buildToolsVersion "27.0.1"

defaultConfig {
applicationId "org.wordcamp.android"
Expand Down Expand Up @@ -41,17 +47,17 @@ android {
}

dependencies {
compile 'com.android.support:design:23.0.1'
compile 'com.android.support:appcompat-v7:23.0.1'
compile 'com.android.support:cardview-v7:23.0.1'
compile 'com.android.support:recyclerview-v7:23.0.1'
compile 'com.google.code.gson:gson:2.3.1'
compile 'com.squareup.picasso:picasso:2.4.0'
compile "com.android.support:design:$supportLibrariesVersion"
compile "com.android.support:appcompat-v7:$supportLibrariesVersion"
compile "com.android.support:cardview-v7:$supportLibrariesVersion"
compile "com.android.support:recyclerview-v7:$supportLibrariesVersion"
compile 'com.google.code.gson:gson:2.8.2'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'se.emilsjolander:stickylistheaders:2.6.0'
compile 'com.amulyakhare:com.amulyakhare.textdrawable:1.0.1'
compile 'com.parse.bolts:bolts-android:1.2.0'
compile 'de.hdodenhof:circleimageview:1.3.0'
compile 'com.mcxiaoke.volley:library:1.0.17'
compile 'com.mcxiaoke.volley:library:1.0.19'
}

android.buildTypes.all { buildType ->
Expand Down
14 changes: 7 additions & 7 deletions app/src/main/java/org/wordcamp/android/BaseActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,8 @@
import org.wordcamp.android.networking.ResponseListener;
import org.wordcamp.android.networking.WPAPIClient;
import org.wordcamp.android.objects.WordCampDB;
import org.wordcamp.android.objects.wordcamp.WordCampNew;
import org.wordcamp.android.objects.wordcamp.WordCamp;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
Expand Down Expand Up @@ -197,19 +196,20 @@ public void onErrorResponse(VolleyError error) {
public void onResponseReceived(Object o) {
try {
wordCampsList = new ArrayList<>();
WordCampNew[] wordCampNews = (WordCampNew[]) o;
for (WordCampNew wordcamp : wordCampNews) {
WordCamp[] wordCamps = (WordCamp[]) o;
for (WordCamp wordCamp : wordCamps) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss", Locale.getDefault());
Date d = sdf.parse(wordcamp.getModifiedGmt());
WordCampDB wordCampDB = new WordCampDB(wordcamp, d.toString());
Date d = sdf.parse(wordCamp.getModifiedGmt());
WordCampDB wordCampDB = new WordCampDB(wordCamp, d.toString());
if (!wordCampDB.getWc_start_date().isEmpty()) {
wordCampsList.add(wordCampDB);
}
}

communicator.addAllNewWC(wordCampsList);
refreshAllFragmentsData();
stopRefresh();
} catch (ParseException e) {
} catch (Exception e) {
e.printStackTrace();
stopRefresh();
}
Expand Down
6 changes: 0 additions & 6 deletions app/src/main/java/org/wordcamp/android/MyWCFragment.java
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,6 @@ public void onRefresh() {
});
}


@Override
public void onResume() {
super.onResume();
}

public void stopRefresh() {
refreshLayout.setRefreshing(false);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,11 +120,6 @@ public int compare(WordCampDB lhs, WordCampDB rhs) {
});
}

@Override
public void onDetach() {
super.onDetach();
}

public void updateList(List<WordCampDB> wordCampsList) {
wordCampDBs = wordCampsList;
sortWC();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
import org.wordcamp.android.networking.ResponseListener;
import org.wordcamp.android.networking.WPAPIClient;
import org.wordcamp.android.objects.WordCampDB;
import org.wordcamp.android.objects.speaker.Session;
import org.wordcamp.android.objects.speaker.SpeakerNew;
import org.wordcamp.android.objects.wordcamp.WordCampNew;
import org.wordcamp.android.objects.wordcamp.Session;
import org.wordcamp.android.objects.wordcamp.Speaker;
import org.wordcamp.android.objects.wordcamp.WordCamp;
import org.wordcamp.android.wcdetails.MySessionsActivity;
import org.wordcamp.android.wcdetails.SessionsFragment;
import org.wordcamp.android.wcdetails.SpeakerFragment;
Expand Down Expand Up @@ -79,7 +79,7 @@ private void initGUI() {
}

private void setToolbar() {
toolbar.setTitle(wcdb.getWc_title());
toolbar.setTitle(wcdb.getFormattedWCTitle());
setSupportActionBar(toolbar);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
}
Expand Down Expand Up @@ -236,7 +236,7 @@ public void onErrorResponse(VolleyError error) {

@Override
public void onResponseReceived(Object o) {
SpeakerNew[] speakerNews = (SpeakerNew[]) o;
Speaker[] speakerNews = (Speaker[]) o;

for (int i = 0; i < speakerNews.length; i++) {
try {
Expand Down Expand Up @@ -303,7 +303,7 @@ public void onResponseReceived(Object o) {
wcResponseListener = new ResponseListener() {
@Override
public void onResponseReceived(Object o) {
WordCampNew wordCamp = (WordCampNew) o;
WordCamp wordCamp = (WordCamp) o;
WordCampDB wordCampDB = new WordCampDB(wordCamp, "");
communicator.updateWC(wordCampDB);
WordCampOverview overview = getOverViewFragment();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ public abstract class CacheFragmentStatePagerAdapter extends FragmentStatePagerA
private static final String STATE_PAGE_INDEX_PREFIX = "pageIndex:";
private static final String STATE_PAGE_KEY_PREFIX = "page:";

private FragmentManager mFm;
private SparseArray<Fragment> mPages;
private final FragmentManager mFm;
private final SparseArray<Fragment> mPages;

public CacheFragmentStatePagerAdapter(FragmentManager fm) {
super(fm);
Expand Down Expand Up @@ -134,7 +134,7 @@ public Fragment getItemAt(int position) {
* @param index index of the item in the adapter
* @return key string for caching Fragment pages
*/
protected String createCacheIndex(int index) {
private String createCacheIndex(int index) {
return STATE_PAGE_INDEX_PREFIX + index;
}

Expand All @@ -144,7 +144,7 @@ protected String createCacheIndex(int index) {
* @param position position of the item in the adapter
* @return key string for caching Fragment pages
*/
protected String createCacheKey(int position) {
private String createCacheKey(int position) {
return STATE_PAGE_KEY_PREFIX + position;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@
*/
public class SessionDetailAdapter extends BaseAdapter {

private Context mContext;
private List<MiniSpeaker> speakers;
private LayoutInflater inflater;
private final Context mContext;
private final List<MiniSpeaker> speakers;
private final LayoutInflater inflater;

public SessionDetailAdapter(Context ctx, List<MiniSpeaker> speakerList){
mContext = ctx;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,13 @@ public class SessionsListAdapter extends BaseAdapter implements StickyListHeader
private Context ctx;
private LayoutInflater inflater;
private OnAddToMySessionListener listener;
private int singleLineSize, doubleLineSize;

public SessionsListAdapter(Context ctx, List<SessionDB> dbList, HashMap<Integer, String> speakersForSession, OnAddToMySessionListener listener) {
this.ctx = ctx;
this.listener = listener;
this.list = dbList;
this.speakersForSession = speakersForSession;
inflater = LayoutInflater.from(ctx);
singleLineSize = (int) ctx.getResources().getDimension(R.dimen.single_line_list_item);
doubleLineSize = (int) ctx.getResources().getDimension(R.dimen.double_line_list_item);
}

@Override
Expand All @@ -61,8 +58,8 @@ public View getView(final int position, View convertView, ViewGroup parent) {
holder.location.setText(Html.fromHtml(sessionDB.getLocation()));
if (speakersForSession.containsKey(sessionDB.getPost_id())) {
holder.speakers.setVisibility(View.VISIBLE);
holder.speakers.setText(ctx.getString(R.string.separator)
+ speakersForSession.get(sessionDB.getPost_id()));
holder.speakers.setText(String.format("%s%s", ctx.getString(R.string.separator)
, speakersForSession.get(sessionDB.getPost_id())));
} else {
holder.speakers.setVisibility(View.GONE);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,8 @@ public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {

@Override
public void onBindViewHolder(final ViewHolder holder, final int position) {

final WordCampDB wc = filteredWordCamps.get(position);
holder.title.setText(wc.getWc_title());
holder.title.setText(wc.getFormattedWCTitle());
holder.date.setText(WordCampUtils.getProperDate(wc));
if (wc.isMyWC) {
Picasso.with(ctx).load(R.drawable.ic_favorite_solid_24dp).into(holder.bookmark);
Expand All @@ -68,24 +67,25 @@ public void onBindViewHolder(final ViewHolder holder, final int position) {
holder.bookmark.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
int holderPosition = holder.getAdapterPosition();
if (!wc.isMyWC) {
listener.addToMyWC(wc.getWc_id(), position);
listener.addToMyWC(wc.getWc_id(), holderPosition);
Picasso.with(ctx).load(R.drawable.ic_favorite_solid_24dp).into(holder.bookmark);
wc.isMyWC = true;
filteredWordCamps.set(position, wc);
filteredWordCamps.set(holderPosition, wc);
} else {
Picasso.with(ctx).load(R.drawable.ic_favorite_outline_24dp).into(holder.bookmark);
wc.isMyWC = false;
filteredWordCamps.set(position, wc);
listener.removeMyWC(wc.getWc_id(), position);
filteredWordCamps.set(holderPosition, wc);
listener.removeMyWC(wc.getWc_id(), holderPosition);
}
}
});

holder.itemView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
WordCampDB wc = getItem(position);
WordCampDB wc = getItem(holder.getAdapterPosition());
wcSelectedListener.onWCSelected(wc);
}
});
Expand Down
Loading