Skip to content

Commit

Permalink
commit
Browse files Browse the repository at this point in the history
  • Loading branch information
u0509421 committed Apr 16, 2016
1 parent 7eed30c commit 2cf8213
Show file tree
Hide file tree
Showing 14 changed files with 63 additions and 39 deletions.
6 changes: 6 additions & 0 deletions .idea/encodings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 9 additions & 1 deletion .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,5 @@ dependencies {
compile 'com.prolificinteractive:material-calendarview:1.2.0'
compile 'com.roughike:bottom-bar:1.1.5'
compile project(':volley')
compile 'com.joanzapata.iconify:android-iconify-fontawesome:2.2.2'
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,18 @@
import android.content.ContentValues;
import android.content.Intent;
import android.database.sqlite.SQLiteDatabase;
import android.graphics.Typeface;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.text.method.ScrollingMovementMethod;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.widget.TextView;
import android.widget.Toast;

import com.android.volley.RequestQueue;
import com.android.volley.Response;
import com.android.volley.VolleyError;
import com.android.volley.toolbox.JsonObjectRequest;
import com.android.volley.toolbox.Volley;
import com.u0509421.todayinhistory.db.HistoryDb;
import com.u0509421.todayinhistory.R;
import com.u0509421.todayinhistory.util.VolleyUtil;
Expand All @@ -39,7 +34,7 @@ public class DayActivity extends AppCompatActivity {
private static final String KEY = "http://v.juhe.cn/todayOnhistory/queryDetail.php?key=a87c2d7033aedc2b2460de9117588285&e_id=";
private String title,date,eid;

private HistoryDb historyDb;
private com.u0509421.todayinhistory.db.HistoryDb historyDb;
private SQLiteDatabase dbWrite;
private ContentValues cv;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,15 @@



import android.os.PersistableBundle;
import android.support.design.widget.CoordinatorLayout;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import com.roughike.bottombar.BottomBar;
import com.roughike.bottombar.BottomBarFragment;
import com.u0509421.todayinhistory.R;
import com.u0509421.todayinhistory.view.EverydayFragment;
import com.u0509421.todayinhistory.view.MoreFragment;
import com.u0509421.todayinhistory.view.StarFragment;
import com.u0509421.todayinhistory.view.TodayFragment;
import com.u0509421.todayinhistory.view.FragmentEveryday;
import com.u0509421.todayinhistory.view.FragmentMore;
import com.u0509421.todayinhistory.view.FragmentFavourite;
import com.u0509421.todayinhistory.view.FragmentToday;

public class MainActivity extends AppCompatActivity{

Expand All @@ -25,10 +23,10 @@ protected void onCreate(Bundle savedInstanceState) {

mBottomBar = BottomBar.attach(this,savedInstanceState);
mBottomBar.setFragmentItems(getSupportFragmentManager(),R.id.fragmentContainer,
new BottomBarFragment(TodayFragment.newInstance(),R.drawable.ic_today,"今天"),
new BottomBarFragment(EverydayFragment.newInstance(),R.drawable.ic_everyday,"每天"),
new BottomBarFragment(StarFragment.newInstance(),R.drawable.ic_favorites,"收藏"),
new BottomBarFragment(MoreFragment.newInstance(),R.drawable.ic_more,"更多"));
new BottomBarFragment(FragmentToday.newInstance(),R.drawable.ic_today,"今天"),
new BottomBarFragment(FragmentEveryday.newInstance(),R.drawable.ic_everyday,"每天"),
new BottomBarFragment(FragmentFavourite.newInstance(),R.drawable.ic_favorites,"收藏"),
new BottomBarFragment(FragmentMore.newInstance(),R.drawable.ic_more,"更多"));

mBottomBar.mapColorForTab(0, "#836464");
mBottomBar.mapColorForTab(1,"#836464");
Expand Down
18 changes: 18 additions & 0 deletions app/src/main/java/com/u0509421/todayinhistory/MyApplication.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package com.u0509421.todayinhistory;

import android.app.Application;

import com.joanzapata.iconify.Iconify;
import com.joanzapata.iconify.fonts.FontAwesomeModule;

/**
* Created by Terry on 16/4/16.
*/
public class MyApplication extends Application {

@Override
public void onCreate() {
super.onCreate();
Iconify.with(new FontAwesomeModule());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
/**
* Created by Terry on 21/3/16.
*/
public class EverydayFragment extends Fragment implements OnDateSelectedListener,OnMonthChangedListener {
public class FragmentEveryday extends Fragment implements OnDateSelectedListener,OnMonthChangedListener {

private static final DateFormat FORMATTER = SimpleDateFormat.getDateInstance();

Expand All @@ -32,11 +32,11 @@ public class EverydayFragment extends Fragment implements OnDateSelectedListener

private Bundle bundle;

public EverydayFragment() {
public FragmentEveryday() {
}

public static EverydayFragment newInstance() {
EverydayFragment sampleFragment = new EverydayFragment();
public static FragmentEveryday newInstance() {
FragmentEveryday sampleFragment = new FragmentEveryday();
return sampleFragment;
}

Expand All @@ -60,7 +60,7 @@ public void onMonthChanged(MaterialCalendarView widget, CalendarDay date) {
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View rootView = inflater.inflate(R.layout.fragment_date_select,container,false);
View rootView = inflater.inflate(R.layout.fragment_everyday,container,false);

((AppCompatActivity)getActivity()).getSupportActionBar().setDisplayShowTitleEnabled(true);
((AppCompatActivity)getActivity()).setTitle("历史上的每天");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
/**
* Created by Terry on 21/3/16.
*/
public class StarFragment extends Fragment {
public class FragmentFavourite extends Fragment {

private ListView sList_star;
private EventListAdapter sAdapter;
Expand All @@ -33,19 +33,19 @@ public class StarFragment extends Fragment {
private HistoryDb historyDb;
private SQLiteDatabase dbRead;

public StarFragment() {
public FragmentFavourite() {
}

public static StarFragment newInstance() {
StarFragment sampleFragment = new StarFragment();
public static FragmentFavourite newInstance() {
FragmentFavourite sampleFragment = new FragmentFavourite();
return sampleFragment;
}

@Nullable
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {

View rootView = inflater.inflate(R.layout.fragment_star,container,false);
View rootView = inflater.inflate(R.layout.fragment_favourite,container,false);
((AppCompatActivity)getActivity()).getSupportActionBar().setDisplayShowTitleEnabled(true);
((AppCompatActivity)getActivity()).setTitle("收藏");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,17 @@
/**
* Created by Terry on 21/3/16.
*/
public class MoreFragment extends Fragment {
public class FragmentMore extends Fragment {

private ListView list_more;
private MoreListAdapter mAdapter;
private ArrayList<MoreItem> list;

public MoreFragment() {
public FragmentMore() {
}

public static MoreFragment newInstance() {
MoreFragment sampleFragment = new MoreFragment();
public static FragmentMore newInstance() {
FragmentMore sampleFragment = new FragmentMore();
return sampleFragment;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,9 @@
import android.widget.ListView;
import android.widget.Toast;

import com.android.volley.RequestQueue;
import com.android.volley.Response;
import com.android.volley.VolleyError;
import com.android.volley.toolbox.JsonObjectRequest;
import com.android.volley.toolbox.Volley;
import com.u0509421.todayinhistory.activities.DayActivity;
import com.u0509421.todayinhistory.adapter.EventListAdapter;
import com.u0509421.todayinhistory.bean.EventList;
Expand All @@ -35,18 +33,18 @@
/**
* Created by Terry on 21/3/16.
*/
public class TodayFragment extends Fragment {
public class FragmentToday extends Fragment {

private ArrayList<EventList> list = new ArrayList<EventList>();
private ListView list_today;
private EventListAdapter adapter;
private String monthTemp = null,dayTemp = null,month = null,day = null;

public TodayFragment() {
public FragmentToday() {
}

public static TodayFragment newInstance() {
TodayFragment sampleFragment = new TodayFragment();
public static FragmentToday newInstance() {
FragmentToday sampleFragment = new FragmentToday();
return sampleFragment;
}

Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.5.0'
classpath 'com.android.tools.build:gradle:2.0.0'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.8-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-2.10-all.zip

0 comments on commit 2cf8213

Please sign in to comment.