Skip to content

Commit

Permalink
Fixes #46
Browse files Browse the repository at this point in the history
Fixes #45
  • Loading branch information
bknatterud committed Mar 11, 2015
1 parent 8ae3525 commit 83f2cfb
Show file tree
Hide file tree
Showing 36 changed files with 338 additions and 129 deletions.
1 change: 1 addition & 0 deletions app/app/app-app.iml
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@
<orderEntry type="library" exported="" name="appcompat-v7-21.0.3" level="project" />
<orderEntry type="library" exported="" name="support-annotations-21.0.3" level="project" />
<orderEntry type="library" exported="" name="support-v4-21.0.3" level="project" />
<orderEntry type="library" exported="" name="prov-1.51.0.0" level="project" />
<orderEntry type="library" exported="" name="universal-image-loader-1.9.3" level="project" />
</component>
</module>
Expand Down
1 change: 1 addition & 0 deletions app/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,5 @@ dependencies {
compile 'com.android.support:appcompat-v7:21.0.3'
compile 'com.nostra13.universalimageloader:universal-image-loader:1.9.3'
compile 'com.android.support:support-v4:21.0.3'
compile files('libs/prov-1.51.0.0.jar')
}
Binary file added app/app/libs/prov-1.51.0.0.jar
Binary file not shown.
12 changes: 6 additions & 6 deletions app/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,27 +24,27 @@
</activity>

<activity
android:name="activity.selectionActivities.ChapterSelectionActivity"
android:name="activity.bookSelection.ChapterSelectionActivity"
android:configChanges="orientation|keyboardHidden"
android:theme="@style/Theme.AppCompat" />
<activity
android:name="activity.selectionActivities.InitialPageActivity"
android:name="activity.bookSelection.InitialPageActivity"
android:configChanges="orientation|keyboardHidden"
android:theme="@style/Theme.AppCompat" />
<activity
android:name="activity.selectionActivities.BookSelectionActivity"
android:name="activity.bookSelection.BookSelectionActivity"
android:configChanges="orientation|keyboardHidden"
android:theme="@style/Theme.AppCompat" />
<activity
android:name="activity.selectionActivities.VersionSelectionActivity"
android:name="activity.bookSelection.VersionSelectionActivity"
android:configChanges="orientation|keyboardHidden"
android:theme="@style/Theme.AppCompat" />
<activity
android:name="activity.ReadingActivity"
android:name="activity.reading.ReadingActivity"
android:configChanges="orientation|keyboardHidden"
android:theme="@style/Theme.AppCompat" />
<activity
android:name="activity.StoryReadingActivity"
android:name="activity.reading.StoryReadingActivity"
android:configChanges="orientation|keyboardHidden"
android:theme="@style/Theme.AppCompat" />
<activity
Expand Down
19 changes: 16 additions & 3 deletions app/app/src/main/java/activity/SettingsActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import android.annotation.TargetApi;
import android.content.Context;
import android.content.res.Configuration;
import android.content.res.Resources;
import android.media.Ringtone;
import android.media.RingtoneManager;
import android.net.Uri;
Expand Down Expand Up @@ -61,6 +62,20 @@ private void setupSimplePreferencesScreen() {

addPreferencesFromResource(R.xml.pref_general);

Preference button = (Preference)findPreference("reset_url");
button.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() {
@Override
public boolean onPreferenceClick(Preference arg0) {

Resources resources = getResources();
PreferenceManager.getDefaultSharedPreferences(getApplicationContext()).
edit().putString("base_url", resources.getString(R.string.pref_default_base_url)).commit();
setPreferenceScreen(null);
setupSimplePreferencesScreen();
return true;
}
});

// Add 'notifications' preferences, and a corresponding header.
// PreferenceCategory fakeHeader = new PreferenceCategory(this);
// fakeHeader.setTitle(R.string.pref_header_data);
Expand Down Expand Up @@ -124,9 +139,7 @@ public void onBuildHeaders(List<Header> target) {
public boolean onPreferenceChange(Preference preference, Object value) {
String stringValue = value.toString();


preference.setSummary(stringValue);

preference.setSummary(stringValue);
return true;
}
};
Expand Down
7 changes: 3 additions & 4 deletions app/app/src/main/java/activity/SplashScreenActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,9 @@
import org.unfoldingword.mobile.R;

import java.io.IOException;
import java.util.ArrayList;

import activity.selectionActivities.InitialPageActivity;
import model.db.DBManager;
import activity.bookSelection.InitialPageActivity;
import model.database.DBManager;
import utils.URLUtils;

/**
Expand Down Expand Up @@ -42,7 +41,7 @@ protected void onCreate(Bundle savedInstanceState) {
private void setUI() {
dbManager = DBManager.getInstance(this);

PreferenceManager.getDefaultSharedPreferences(this).edit().clear().commit();
PreferenceManager.setDefaultValues(this, R.xml.pref_general, false);
execute = new GetLanguageListAndFrames().execute(URLUtils.LANGUAGE_INFO, URLUtils.CHAPTER_INFO);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package activity.selectionActivities;
package activity.bookSelection;

import android.content.Context;
import android.os.Bundle;
Expand All @@ -9,10 +9,10 @@
import java.util.ArrayList;
import java.util.Collections;

import adapter.selectionAdapters.GeneralRowInterface;
import adapter.selectionAdapters.InitialPageModel;
import adapters.selectionAdapters.GeneralRowInterface;
import adapters.selectionAdapters.InitialPageModel;
import model.datasource.ProjectDataSource;
import model.db.DBManager;
import model.database.DBManager;
import model.modelClasses.mainData.LanguageModel;
import model.modelClasses.mainData.ProjectModel;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package activity.selectionActivities;
package activity.bookSelection;

import android.os.Bundle;
import android.preference.PreferenceManager;
Expand All @@ -12,12 +12,11 @@
import java.util.ArrayList;
import java.util.Collections;

import activity.ReadingActivity;
import activity.StoryReadingActivity;
import adapter.selectionAdapters.GeneralRowInterface;
import adapter.selectionAdapters.StoriesChapterAdapter;
import activity.reading.ReadingActivity;
import activity.reading.StoryReadingActivity;
import adapters.selectionAdapters.GeneralRowInterface;
import adapters.selectionAdapters.StoriesChapterAdapter;
import model.datasource.VersionDataSource;
import model.db.DBManager;
import model.modelClasses.mainData.BibleChapterModel;
import model.modelClasses.mainData.BookModel;
import model.modelClasses.mainData.LanguageModel;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package activity.selectionActivities;
package activity.bookSelection;

import android.content.Intent;
import android.graphics.drawable.Drawable;
import android.os.Build;
import android.os.Bundle;
import android.preference.PreferenceManager;
Expand All @@ -11,7 +10,6 @@
import android.view.View;
import android.widget.AdapterView;
import android.widget.Button;
import android.widget.ImageButton;
import android.widget.ListView;
import android.widget.TextView;
import android.widget.Toast;
Expand All @@ -20,9 +18,9 @@

import java.util.ArrayList;

import adapter.selectionAdapters.GeneralAdapter;
import adapter.selectionAdapters.GeneralRowInterface;
import model.db.DBManager;
import adapters.selectionAdapters.GeneralAdapter;
import adapters.selectionAdapters.GeneralRowInterface;
import model.database.DBManager;
import view.popover.ActionItem;
import view.popover.QuickAction;

Expand Down Expand Up @@ -105,6 +103,7 @@ private String getCurrentLanguage(){
i++;
}
}

return "Language";
}

Expand Down Expand Up @@ -206,7 +205,7 @@ public void onBackPressed() {
@Override
protected void onResume() {
super.onResume();
prepareListView();
setUI();
}

public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package activity.selectionActivities;
package activity.bookSelection;

import android.app.AlertDialog;
import android.content.BroadcastReceiver;
Expand All @@ -11,23 +11,20 @@
import android.widget.Button;
import android.widget.FrameLayout;
import android.widget.ListView;
import android.widget.TextView;
import android.widget.Toast;

import org.unfoldingword.mobile.BuildConfig;
import org.unfoldingword.mobile.R;

import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;

import activity.SettingsActivity;
import adapter.selectionAdapters.GeneralAdapter;
import adapter.selectionAdapters.GeneralRowInterface;
import adapter.selectionAdapters.InitialPageModel;
import adapters.selectionAdapters.GeneralAdapter;
import adapters.selectionAdapters.GeneralRowInterface;
import adapters.selectionAdapters.InitialPageModel;
import model.datasource.ProjectDataSource;
import model.db.DBManager;
import model.database.DBManager;
import model.modelClasses.mainData.LanguageModel;
import model.modelClasses.mainData.ProjectModel;
import services.UpdateService;
Expand All @@ -45,6 +42,7 @@ public class InitialPageActivity extends GeneralSelectionActivity implements Vie

FrameLayout visibleLayout = null;
Button mRefreshButton = null;
Button settingsButton = null;
/**
* This broadcast for When the update is completed
*/
Expand Down Expand Up @@ -101,19 +99,22 @@ protected Class getChildClass(GeneralRowInterface row){
protected void setUI() {
super.setUI();

LayoutInflater inflater = getLayoutInflater();
View footerView = inflater.inflate(R.layout.settings_footer, null);
if(settingsButton == null) {
LayoutInflater inflater = getLayoutInflater();
View footerView = inflater.inflate(R.layout.settings_footer, null);


// change version number
Button footerButton = (Button) footerView.findViewById(R.id.settings_button);
footerButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
moveToSettings();
}
});
mListView.addFooterView(footerView);
// change version number
settingsButton = (Button) footerView.findViewById(R.id.settings_button);
settingsButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
moveToSettings();
}
});
mListView.addFooterView(footerView);
this.actionbarTextView.setText("Unfolding Word");
}
}

private void moveToSettings(){
Expand Down Expand Up @@ -164,7 +165,12 @@ public void onWindowFocusChanged(boolean hasFocus) {

super.onlySuperOnWindowFocusChanged(hasFocus);
int width = this.languagesButton.getMeasuredWidth();
actionbarTextView.setPadding(width, 0, 5, 0);
if(width > 1) {
actionbarTextView.setPadding(width, 0, 5, 0);
}
else{
actionbarTextView.setPadding(200, 0, 5, 0);
}
}

@Override
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package activity.selectionActivities;
package activity.bookSelection;

import android.os.Bundle;
import android.preference.PreferenceManager;
Expand All @@ -12,8 +12,8 @@

import java.util.ArrayList;

import adapter.selectionAdapters.GeneralRowInterface;
import adapter.selectionAdapters.VersionAdapter;
import adapters.selectionAdapters.GeneralRowInterface;
import adapters.selectionAdapters.VersionAdapter;
import model.datasource.LanguageDataSource;
import model.modelClasses.mainData.LanguageModel;
import model.modelClasses.mainData.VersionModel;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,27 +1,24 @@
package activity;
package activity.reading;


import android.content.Context;
import android.os.Bundle;
import android.os.Handler;
import android.preference.PreferenceManager;
import android.support.v4.view.ViewPager;
import android.support.v7.app.ActionBar;
import android.view.Display;
import android.view.MenuItem;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewConfiguration;

import com.nostra13.universalimageloader.core.ImageLoader;

import org.unfoldingword.mobile.R;

import java.util.ArrayList;

import activity.selectionActivities.GeneralSelectionActivity;
import adapter.ReadingPagerAdapter;
import adapter.selectionAdapters.GeneralRowInterface;
import activity.bookSelection.GeneralSelectionActivity;
import adapters.ReadingPagerAdapter;
import adapters.selectionAdapters.GeneralRowInterface;
import model.datasource.BibleChapterDataSource;
import model.modelClasses.mainData.BibleChapterModel;
import model.modelClasses.mainData.LanguageModel;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
package activity;
package activity.reading;


import android.content.Context;
import android.os.Bundle;
import android.os.Handler;
import android.preference.PreferenceManager;
import android.support.v4.view.ViewPager;
import android.support.v7.app.ActionBar;
import android.view.Display;
import android.view.MenuItem;
import android.view.MotionEvent;
Expand All @@ -20,9 +19,9 @@

import java.util.ArrayList;

import activity.selectionActivities.GeneralSelectionActivity;
import adapter.selectionAdapters.GeneralRowInterface;
import adapter.StoryPagerAdapter;
import activity.bookSelection.GeneralSelectionActivity;
import adapters.selectionAdapters.GeneralRowInterface;
import adapters.StoryPagerAdapter;
import model.datasource.StoriesChapterDataSource;
import model.modelClasses.mainData.LanguageModel;
import model.modelClasses.mainData.StoriesChapterModel;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package adapter;
package adapters;

import android.app.Activity;
import android.content.Context;
Expand All @@ -19,9 +19,8 @@
import java.util.ArrayList;
import java.util.Collections;

import model.db.DBManager;
import model.database.DBManager;
import model.modelClasses.mainData.BibleChapterModel;
import model.modelClasses.mainData.StoriesChapterModel;
import model.modelClasses.mainData.VersionModel;

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package adapter;
package adapters;

import android.app.Activity;
import android.content.Context;
Expand All @@ -25,7 +25,7 @@

import java.util.ArrayList;

import model.db.DBManager;
import model.database.DBManager;
import model.modelClasses.mainData.StoriesChapterModel;
import utils.URLUtils;

Expand Down
Loading

0 comments on commit 83f2cfb

Please sign in to comment.