forked from bradywwang/JLUlife
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
bradywang
committed
Nov 30, 2015
1 parent
8df9372
commit a7e12cc
Showing
47 changed files
with
505 additions
and
314 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
app/src/main/java/com/brady/jlulife/Activities/BaseActivity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package com.brady.jlulife.Activities; | ||
|
||
import android.os.Bundle; | ||
import android.support.v7.app.ActionBar; | ||
import android.support.v7.app.AppCompatActivity; | ||
import android.support.v7.widget.Toolbar; | ||
import android.util.Log; | ||
|
||
import com.brady.jlulife.R; | ||
|
||
/** | ||
* Created by brady on 15-11-30. | ||
*/ | ||
public abstract class BaseActivity extends AppCompatActivity{ | ||
/* @Override | ||
protected void onCreate(Bundle savedInstanceState) { | ||
super.onCreate(savedInstanceState); | ||
initActionBar(); | ||
}*/ | ||
|
||
public void initActionBar(){ | ||
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); | ||
if(toolbar == null){ | ||
Log.e("ttt","toolbar is null"); | ||
} | ||
setSupportActionBar(toolbar); | ||
ActionBar actionBar = getSupportActionBar(); | ||
actionBar.setDisplayShowTitleEnabled(true); | ||
actionBar.setDisplayHomeAsUpEnabled(true); | ||
} | ||
|
||
@Override | ||
protected void onCreate(Bundle savedInstanceState) { | ||
super.onCreate(savedInstanceState); | ||
setContentView(R.layout.activity_main); | ||
initFragment(); | ||
initActionBar(); | ||
} | ||
|
||
public abstract void initFragment(); | ||
} |
21 changes: 21 additions & 0 deletions
21
app/src/main/java/com/brady/jlulife/Activities/CJCXAuthActivity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package com.brady.jlulife.Activities; | ||
|
||
import android.support.v4.app.FragmentManager; | ||
import android.support.v4.app.FragmentTransaction; | ||
|
||
import com.brady.jlulife.Fragments.CjcxAuthFragment; | ||
import com.brady.jlulife.Fragments.DrcomLoginFragment; | ||
import com.brady.jlulife.R; | ||
|
||
/** | ||
* Created by brady on 15-11-30. | ||
*/ | ||
public class CJCXAuthActivity extends BaseActivity { | ||
@Override | ||
public void initFragment() { | ||
FragmentManager manager = getSupportFragmentManager(); | ||
FragmentTransaction transaction = manager.beginTransaction(); | ||
transaction.replace(R.id.main_container, CjcxAuthFragment.getInstance()); | ||
transaction.commit(); | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
app/src/main/java/com/brady/jlulife/Activities/DrcomLoginActivity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package com.brady.jlulife.Activities; | ||
|
||
import android.support.v4.app.FragmentManager; | ||
import android.support.v4.app.FragmentTransaction; | ||
|
||
import com.brady.jlulife.Fragments.DrcomLoginFragment; | ||
import com.brady.jlulife.Fragments.ScoreListFragment; | ||
import com.brady.jlulife.R; | ||
|
||
/** | ||
* Created by brady on 15-11-30. | ||
*/ | ||
public class DrcomLoginActivity extends BaseActivity { | ||
|
||
@Override | ||
public void initFragment() { | ||
FragmentManager manager = getSupportFragmentManager(); | ||
FragmentTransaction transaction = manager.beginTransaction(); | ||
transaction.replace(R.id.main_container, DrcomLoginFragment.getInstance()); | ||
transaction.commit(); | ||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
app/src/main/java/com/brady/jlulife/Activities/JLUNewsListActivity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package com.brady.jlulife.Activities; | ||
|
||
import android.support.v4.app.FragmentManager; | ||
import android.support.v4.app.FragmentTransaction; | ||
|
||
import com.brady.jlulife.Fragments.DrcomLoginFragment; | ||
import com.brady.jlulife.Fragments.News.JLUNewsListFragment; | ||
import com.brady.jlulife.R; | ||
|
||
/** | ||
* Created by brady on 15-11-30. | ||
*/ | ||
public class JLUNewsListActivity extends BaseActivity{ | ||
@Override | ||
public void initFragment() { | ||
FragmentManager manager = getSupportFragmentManager(); | ||
FragmentTransaction transaction = manager.beginTransaction(); | ||
transaction.replace(R.id.main_container, JLUNewsListFragment.getInstance()); | ||
transaction.commit(); | ||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
app/src/main/java/com/brady/jlulife/Activities/JWNewsListActivity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package com.brady.jlulife.Activities; | ||
|
||
import android.support.v4.app.FragmentManager; | ||
import android.support.v4.app.FragmentTransaction; | ||
|
||
import com.brady.jlulife.Fragments.DrcomLoginFragment; | ||
import com.brady.jlulife.Fragments.News.JWNewsListFragment; | ||
import com.brady.jlulife.R; | ||
|
||
/** | ||
* Created by brady on 15-11-30. | ||
*/ | ||
public class JWNewsListActivity extends BaseActivity{ | ||
@Override | ||
public void initFragment() { | ||
FragmentManager manager = getSupportFragmentManager(); | ||
FragmentTransaction transaction = manager.beginTransaction(); | ||
transaction.replace(R.id.main_container, JWNewsListFragment.getInstance()); | ||
transaction.commit(); | ||
} | ||
} |
31 changes: 31 additions & 0 deletions
31
app/src/main/java/com/brady/jlulife/Activities/LibrarySearchActivity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package com.brady.jlulife.Activities; | ||
|
||
import android.support.v4.app.FragmentManager; | ||
import android.support.v4.app.FragmentTransaction; | ||
|
||
import com.brady.jlulife.Fragments.DrcomLoginFragment; | ||
import com.brady.jlulife.Fragments.LibrarySearchFragment; | ||
import com.brady.jlulife.R; | ||
|
||
/** | ||
* Created by brady on 15-11-30. | ||
*/ | ||
public class LibrarySearchActivity extends BaseActivity { | ||
@Override | ||
public void initFragment() { | ||
FragmentManager manager = getSupportFragmentManager(); | ||
FragmentTransaction transaction = manager.beginTransaction(); | ||
transaction.replace(R.id.main_container, LibrarySearchFragment.getInstance()); | ||
transaction.commit(); | ||
} | ||
|
||
@Override | ||
public void onBackPressed() { | ||
LibrarySearchFragment fragment = LibrarySearchFragment.getInstance(); | ||
if(fragment.isAdded()&&fragment.canGoBack()){ | ||
LibrarySearchFragment.getInstance().preformBack(); | ||
}else { | ||
super.onBackPressed(); | ||
} | ||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
app/src/main/java/com/brady/jlulife/Activities/LoginSuccessActivity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package com.brady.jlulife.Activities; | ||
|
||
import android.support.v4.app.FragmentManager; | ||
import android.support.v4.app.FragmentTransaction; | ||
|
||
import com.brady.jlulife.Fragments.DrcomLoginFragment; | ||
import com.brady.jlulife.Fragments.LoginSuccessFragment; | ||
import com.brady.jlulife.R; | ||
|
||
/** | ||
* Created by brady on 15-11-30. | ||
*/ | ||
public class LoginSuccessActivity extends BaseActivity { | ||
@Override | ||
public void initFragment() { | ||
FragmentManager manager = getSupportFragmentManager(); | ||
FragmentTransaction transaction = manager.beginTransaction(); | ||
transaction.replace(R.id.main_container, LoginSuccessFragment.getInstance()); | ||
transaction.commit(); | ||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
app/src/main/java/com/brady/jlulife/Activities/ScoreListActivity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package com.brady.jlulife.Activities; | ||
|
||
import android.support.v4.app.FragmentManager; | ||
import android.support.v4.app.FragmentTransaction; | ||
|
||
import com.brady.jlulife.Fragments.ScoreListFragment; | ||
import com.brady.jlulife.R; | ||
|
||
/** | ||
* Created by brady on 15-11-30. | ||
*/ | ||
public class ScoreListActivity extends BaseActivity { | ||
|
||
@Override | ||
public void initFragment() { | ||
FragmentManager manager = getSupportFragmentManager(); | ||
FragmentTransaction transaction = manager.beginTransaction(); | ||
transaction.replace(R.id.main_container, ScoreListFragment.getInstance()); | ||
transaction.commit(); | ||
} | ||
} |
51 changes: 51 additions & 0 deletions
51
app/src/main/java/com/brady/jlulife/Activities/SemSelectActivity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
package com.brady.jlulife.Activities; | ||
|
||
import android.support.v4.app.FragmentManager; | ||
import android.support.v4.app.FragmentTransaction; | ||
import android.support.v7.app.AppCompatActivity; | ||
import android.os.Bundle; | ||
import android.util.Log; | ||
import android.view.Menu; | ||
import android.view.MenuItem; | ||
|
||
import com.brady.jlulife.Fragments.ClassSyncFragment; | ||
import com.brady.jlulife.Fragments.SemSelectFragment; | ||
import com.brady.jlulife.R; | ||
|
||
public class SemSelectActivity extends BaseActivity { | ||
|
||
@Override | ||
protected void onCreate(Bundle savedInstanceState) { | ||
super.onCreate(savedInstanceState); | ||
setTitle("同步学期"); | ||
} | ||
|
||
@Override | ||
public boolean onCreateOptionsMenu(Menu menu) { | ||
// Inflate the menu; this adds items to the action bar if it is present. | ||
getMenuInflater().inflate(R.menu.menu_sem_select, menu); | ||
return true; | ||
} | ||
|
||
@Override | ||
public boolean onOptionsItemSelected(MenuItem item) { | ||
// Handle action bar item clicks here. The action bar will | ||
// automatically handle clicks on the Home/Up button, so long | ||
// as you specify a parent activity in AndroidManifest.xml. | ||
int id = item.getItemId(); | ||
|
||
//noinspection SimplifiableIfStatement | ||
if (id == R.id.action_settings) { | ||
return true; | ||
} | ||
|
||
return super.onOptionsItemSelected(item); | ||
} | ||
|
||
public void initFragment(){ | ||
FragmentManager manager = getSupportFragmentManager(); | ||
FragmentTransaction transaction = manager.beginTransaction(); | ||
transaction.replace(R.id.main_container, SemSelectFragment.getInstance()); | ||
transaction.commit(); | ||
} | ||
} |
Oops, something went wrong.