Skip to content

Commit

Permalink
Add help wiki pages
Browse files Browse the repository at this point in the history
  • Loading branch information
raffysommy committed Jun 8, 2015
1 parent 82f9362 commit 40a0203
Show file tree
Hide file tree
Showing 6 changed files with 86 additions and 3 deletions.
4 changes: 4 additions & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,10 @@
android:name=".SettingsActivity"
android:label="@string/title_activity_settings" >
</activity>
<activity
android:name=".Help"
android:label="@string/title_activity_help" >
</activity>
</application>

</manifest>
53 changes: 53 additions & 0 deletions app/src/main/java/com/educationet/k12/app/Help.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
package com.educationet.k12.app;

import android.annotation.SuppressLint;
import android.content.Intent;
import android.support.v7.app.ActionBarActivity;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.webkit.WebChromeClient;
import android.webkit.WebView;


public class Help extends ActionBarActivity {

private String topic;
@SuppressLint("SetJavaScriptEnabled")
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_help);
Intent i = getIntent();
topic=i.getStringExtra("topic");
loadpage();
}
private void loadpage(){
WebView myWebView = (WebView) findViewById(R.id.helpView);
myWebView.getSettings().setJavaScriptEnabled(true);
myWebView.setWebChromeClient(new WebChromeClient());
myWebView.loadUrl("https://wiki-raffysommy.c9.io/index.php/" + topic);
}

@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_help, 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);
}
}
9 changes: 6 additions & 3 deletions app/src/main/java/com/educationet/k12/app/Question.java
Original file line number Diff line number Diff line change
Expand Up @@ -338,8 +338,11 @@ public void Score_click(View v){
* @param v Current View
*/
public void Help_click(View v){
//click here bring to explain of arguments
Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("http://k12-api.mybluemix.net/php/learnTopic.php?topic="+Domanda.getTopic()));
startActivity(browserIntent);
//click here bring to explain of
Intent i= new Intent(this,Help.class);
i.putExtra("topic",Domanda.getTopic());
startActivity(i);
//Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("https://wiki-raffysommy.c9.io/index.php/"+Domanda.getTopic()));
//startActivity(browserIntent);
}
}
16 changes: 16 additions & 0 deletions app/src/main/res/layout/activity_help.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent"
android:layout_height="match_parent" android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:paddingBottom="@dimen/activity_vertical_margin"
tools:context="com.educationet.k12.app.Help">

<WebView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:id="@+id/helpView"
android:layout_alignParentTop="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true" />
</RelativeLayout>
6 changes: 6 additions & 0 deletions app/src/main/res/menu/menu_help.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools" tools:context="com.educationet.k12.app.Help">
<item android:id="@+id/action_settings" android:title="@string/action_settings"
android:orderInCategory="100" app:showAsAction="never" />
</menu>
1 change: 1 addition & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@
<string name="title_activity_chat_page">Chat</string>
<string name="title_activity_teacher_question">TeacherQuestion</string>
<string name="crash_report">Unfortunately I\'m crashed, but I sent a report to my developer :)</string>
<string name="title_activity_help">Help</string>
</resources>

0 comments on commit 40a0203

Please sign in to comment.