зеркало из https://github.com/mozilla/Jisort.git
Updates for activity inheritance, file size reduction.
This commit is contained in:
Родитель
6fe07e2b57
Коммит
ddbae28c34
|
@ -79,12 +79,6 @@
|
|||
android:name="android.support.PARENT_ACTIVITY"
|
||||
android:value=".activities.DashboardActivity" />
|
||||
</activity>
|
||||
<activity
|
||||
android:name=".activities.DetailsActivity"
|
||||
android:windowSoftInputMode="stateHidden"
|
||||
android:label="@string/title_activity_details" >
|
||||
|
||||
</activity>
|
||||
|
||||
<activity
|
||||
android:name=".activities.QuizActivity"
|
||||
|
|
|
@ -1,43 +0,0 @@
|
|||
package com.mozilla.hackathon.kiboko.activities;
|
||||
|
||||
import android.support.v4.app.FragmentActivity;
|
||||
import android.support.v7.app.ActionBarActivity;
|
||||
import android.os.Bundle;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuItem;
|
||||
import android.webkit.WebView;
|
||||
|
||||
import com.mozilla.hackathon.kiboko.R;
|
||||
|
||||
public class DetailsActivity extends FragmentActivity {
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_details);
|
||||
WebView browser = (WebView) findViewById(R.id.webview);
|
||||
browser.loadUrl("http://eric.elp.co.ke/kiboko/kiboko/connectivity.html");
|
||||
}
|
||||
|
||||
@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_details, 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);
|
||||
}
|
||||
}
|
|
@ -1,9 +1,8 @@
|
|||
package com.mozilla.hackathon.kiboko.activities;
|
||||
|
||||
import android.support.v7.app.ActionBar;
|
||||
import android.os.Bundle;
|
||||
import android.support.annotation.Nullable;
|
||||
import android.support.v7.app.AppCompatActivity;
|
||||
import android.support.v7.app.ActionBar;
|
||||
import android.view.MenuItem;
|
||||
|
||||
import com.mozilla.hackathon.kiboko.R;
|
||||
|
@ -12,6 +11,7 @@ import com.mozilla.hackathon.kiboko.R;
|
|||
* Created by Brian Mwadime on 06/06/2016.
|
||||
*/
|
||||
public class FindIconsActivity extends DSOActivity {
|
||||
private String TAG = FindIconsActivity.class.getSimpleName();
|
||||
@Override
|
||||
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
|
|
@ -5,7 +5,6 @@ import android.app.AlertDialog;
|
|||
import android.content.DialogInterface;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.support.v7.app.AppCompatActivity;
|
||||
import android.util.Log;
|
||||
import android.view.KeyEvent;
|
||||
import android.view.MenuItem;
|
||||
|
@ -20,10 +19,13 @@ import com.mozilla.hackathon.kiboko.models.Question;
|
|||
|
||||
import java.util.List;
|
||||
|
||||
import static com.mozilla.hackathon.kiboko.utilities.LogUtils.LOGD;
|
||||
|
||||
/**
|
||||
* Created by mwadime on 6/10/2016.
|
||||
*/
|
||||
public class QuizActivity extends AppCompatActivity {
|
||||
public class QuizActivity extends DSOActivity {
|
||||
private String TAG = QuizActivity.class.getSimpleName();
|
||||
List<Question> quesList;
|
||||
int score=0;
|
||||
int qid=0;
|
||||
|
@ -51,7 +53,7 @@ public class QuizActivity extends AppCompatActivity {
|
|||
public void onClick(View v) {
|
||||
RadioGroup grp=(RadioGroup)findViewById(R.id.radioGroup1);
|
||||
RadioButton answer=(RadioButton)findViewById(grp.getCheckedRadioButtonId());
|
||||
Log.d("yourans", currentQ.getANSWER()+" "+answer.getText());
|
||||
LOGD("yourans", currentQ.getANSWER()+" "+answer.getText());
|
||||
if(currentQ.getANSWER().equals(answer.getText()))
|
||||
{
|
||||
score++;
|
||||
|
@ -103,12 +105,6 @@ public class QuizActivity extends AppCompatActivity {
|
|||
onBackPressed();
|
||||
}
|
||||
});
|
||||
dialog.setNegativeButton("Cancel",
|
||||
new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
}
|
||||
});
|
||||
dialog.create().show();
|
||||
}
|
||||
|
||||
|
|
|
@ -11,6 +11,7 @@ import com.mozilla.hackathon.kiboko.R;
|
|||
* Created by Brian Mwadime on 06/06/2016.
|
||||
*/
|
||||
public class TopicListActivity extends DSOActivity {
|
||||
private String TAG = TopicListActivity.class.getSimpleName();
|
||||
@Override
|
||||
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
|
|
@ -51,7 +51,7 @@ public class TutorialSlideActivity extends DSOActivity implements LoaderManager.
|
|||
private static final int LOADER_ID = 0x01;
|
||||
private List<Step> jsonSteps = new ArrayList<Step>();
|
||||
/**
|
||||
* The number of pages (wizard steps) to show in this demo.
|
||||
* The number of pages (wizard steps) to show.
|
||||
*/
|
||||
private static final int NUM_PAGES = 5;
|
||||
|
||||
|
|
|
@ -60,7 +60,7 @@ public class TopicsFragment extends ListFragment implements CompoundButton.OnChe
|
|||
list.add(get("data", "Using your data wisely", R.drawable.circular_money));
|
||||
list.add(get("playstore", "Find new apps!", R.drawable.circular_googleplay));
|
||||
list.add(get("storage", "Free up memory for new apps", R.drawable.circular_sdcard));
|
||||
list.add(get("broken", "Fix broken images and videos", R.drawable.circular_badimage));
|
||||
// list.add(get("broken", "Fix broken images and videos", R.drawable.circular_badimage));
|
||||
list.add(get("icons", "What is that icon?", R.drawable.circular_help));
|
||||
list.add(get("airplane_mode", "Using Airplane Mode", R.drawable.circular_airplane));
|
||||
list.add(get("accounts_passwords", "Strengthen your Passwords!", R.drawable.circular_account));
|
||||
|
@ -109,7 +109,6 @@ public class TopicsFragment extends ListFragment implements CompoundButton.OnChe
|
|||
requestPermission(OVERLAY_PERMISSION_REQ_CODE_CHATHEAD);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -128,12 +127,6 @@ public class TopicsFragment extends ListFragment implements CompoundButton.OnChe
|
|||
requestPermission(requestCode);
|
||||
}
|
||||
});
|
||||
builder.setNegativeButton("Cancel", new android.content.DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
|
||||
}
|
||||
});
|
||||
builder.setCancelable(false);
|
||||
builder.show();
|
||||
}
|
||||
|
@ -168,7 +161,6 @@ public class TopicsFragment extends ListFragment implements CompoundButton.OnChe
|
|||
}else{
|
||||
startOverlayService();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче