Skip to content

Commit

Permalink
updates for new ui layout
Browse files Browse the repository at this point in the history
content can now be downloaded on a per item basis
resources are not preloaded yet
  • Loading branch information
bknatterud committed Mar 31, 2015
1 parent 5a77b72 commit 39d3b9a
Show file tree
Hide file tree
Showing 143 changed files with 4,670 additions and 2,160 deletions.
2 changes: 2 additions & 0 deletions app/app/app-app.iml
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,11 @@
</content>
<orderEntry type="jdk" jdkName="Android API 21 Platform" jdkType="Android SDK" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" exported="" name="gson-2.3.1" level="project" />
<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="core-1.51.0.0" 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>
Expand Down
2 changes: 2 additions & 0 deletions app/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,6 @@ dependencies {
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')
compile files('libs/core-1.51.0.0.jar')
compile 'com.google.code.gson:gson:2.3.1'
}
Binary file added app/app/libs/core-1.51.0.0.jar
Binary file not shown.
7 changes: 6 additions & 1 deletion app/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
</activity>

<activity
android:name="activity.bookSelection.ChapterSelectionActivity"
android:name="activity.bookSelection.StoryChapterSelectionActivity"
android:configChanges="orientation|keyboardHidden"
android:theme="@style/Theme.AppCompat" />
<activity
Expand All @@ -35,6 +35,10 @@
android:name="activity.bookSelection.BookSelectionActivity"
android:configChanges="orientation|keyboardHidden"
android:theme="@style/Theme.AppCompat" />
<activity
android:name="activity.bookSelection.BibleChapterSelectionActivity"
android:configChanges="orientation|keyboardHidden"
android:theme="@style/Theme.AppCompat" />
<activity
android:name="activity.bookSelection.VersionSelectionActivity"
android:configChanges="orientation|keyboardHidden"
Expand All @@ -53,6 +57,7 @@
</activity>

<service android:name="services.UpdateService" />
<service android:name="services.VersionDownloadService" />


</application>
Expand Down
Binary file modified app/app/src/main/assets/_un_folding_word
Binary file not shown.
5 changes: 5 additions & 0 deletions app/app/src/main/assets/certs/ca.pub
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
-----BEGIN PUBLIC KEY-----
MHYwEAYHKoZIzj0CAQYFK4EEACIDYgAESwmkZ0AJIQo9cELigBaEPaVbQYnWOWhq
ouunp1AGWSgv+KvV/RS9AiRAMjgr4robcgxDjjrdrESyCiTbRehl1yGT0NxfkGhp
qkjQDUV4/4UH63jfRO3F6d1DtBvrxXJp
-----END PUBLIC KEY-----
7 changes: 0 additions & 7 deletions app/app/src/main/java/activity/SettingsActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,12 @@
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;
import android.os.Build;
import android.os.Bundle;
import android.preference.ListPreference;
import android.preference.Preference;
import android.preference.PreferenceActivity;
import android.preference.PreferenceCategory;
import android.preference.PreferenceFragment;
import android.preference.PreferenceManager;
import android.preference.RingtonePreference;
import android.text.TextUtils;

import org.unfoldingword.mobile.R;

Expand Down
1 change: 0 additions & 1 deletion app/app/src/main/java/activity/SplashScreenActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@

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

/**
* Created by Acts Media Inc. on 2/12/14.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,157 @@
package activity.bookSelection;

import android.os.Bundle;
import android.preference.PreferenceManager;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ListView;
import android.widget.TextView;

import org.unfoldingword.mobile.R;

import java.util.ArrayList;
import java.util.Collections;

import activity.reading.ReadingActivity;
import adapters.selectionAdapters.GeneralAdapter;
import adapters.selectionAdapters.GeneralRowInterface;
import model.datasource.BibleChapterDataSource;
import model.datasource.BookDataSource;
import model.modelClasses.mainData.BibleChapterModel;
import model.modelClasses.mainData.BookModel;
import utils.UWPreferenceManager;

/**
* Created by Fechner on 2/27/15.
*/
public class BibleChapterSelectionActivity extends GeneralSelectionActivity{

public static String STORY_CHAPTERS_INDEX_STRING = "STORY_CHAPTERS_INDEX_STRING";

private int resultCode = 0;

@Override
protected int getContentView() {
return R.layout.activity_general_list;
}

@Override
protected String getIndexStorageString() {
return STORY_CHAPTERS_INDEX_STRING;
}

@Override
protected Class getChildClass() {
return null;
}

protected String getActionBarTitle() {
return "Select Chapter";
}


@Override
protected void setUI() {
setupActionBar();
}

private void setupActionBar(){

mActionBar = getSupportActionBar();
View view = getLayoutInflater().inflate(R.layout.actionbar_base, null);
mActionBar.setCustomView(view);
mActionBar.setDisplayShowCustomEnabled(true);
mActionBar.setDisplayShowHomeEnabled(true);
mActionBar.setHomeButtonEnabled(true);
mActionBar.setDisplayHomeAsUpEnabled(true);

actionbarTextView = (TextView) view.findViewById(R.id.actionbarTextView);
actionbarTextView.setText(getActionBarTitle());
}


@Override
protected void prepareListView() {

ArrayList<GeneralRowInterface> data = this.getData();

if (mListView == null) {
mListView = (ListView) findViewById(R.id.generalList);
}
if (data == null) {
return;
}
else if (data != null || data.size() == 0) {
actionbarTextView.setText(getActionBarTitle());
}

mListView.setOnItemClickListener(this);
GeneralAdapter adapter = new GeneralAdapter(this.getApplicationContext(), data, this.actionbarTextView, this, this.getIndexStorageString());
mListView.setAdapter(adapter);

int scrollPosition = PreferenceManager.getDefaultSharedPreferences(getApplicationContext()).getInt(STORY_CHAPTERS_INDEX_STRING, -1);
mListView.setSelection((scrollPosition > 0)? scrollPosition - 1 : 0);
}

protected ArrayList<GeneralRowInterface> getData(){

Bundle extras = getIntent().getExtras();
if (extras != null) {

String chosenBook = extras.getString(CHOSEN_ID);

BookModel book = new BookDataSource(getApplicationContext()).getModel(chosenBook);

ArrayList<GeneralRowInterface> data = new ArrayList<GeneralRowInterface>();

ArrayList<BibleChapterModel> chapters = book.getBibleChildModels(getApplicationContext());
Collections.sort(chapters);

long chapterId = Long.parseLong(UWPreferenceManager.getSelectedBibleChapter(getApplicationContext()));

int i = 0;
for (BibleChapterModel model : chapters) {
if(model.uid == chapterId){
PreferenceManager.getDefaultSharedPreferences(getApplicationContext()).edit().putInt(STORY_CHAPTERS_INDEX_STRING, i).commit();
}
data.add(model);
i++;
}
return data;
}

return null;
}

@Override
public void onItemClick(AdapterView<?> adapterView, View view, int position, long rowIndex) {

Object itemAtPosition = adapterView.getItemAtPosition(position);

if (itemAtPosition instanceof BibleChapterModel) {
BibleChapterModel model = (BibleChapterModel) itemAtPosition;

UWPreferenceManager.setSelectedBibleChapter(getApplicationContext(), model.uid);
}
resultCode = 1;
setResult(resultCode);
PreferenceManager.getDefaultSharedPreferences(this).edit().putInt(ReadingActivity.BOOK_INDEX_STRING, -1).commit();
finish();
overridePendingTransition(R.anim.enter_center, R.anim.exit_on_bottom);
}

@Override
protected void onStop() {
setResult(resultCode);
super.onStop();
}

@Override
protected void onDestroy() {
setResult(resultCode);
super.onDestroy();
}

public void closeButtonClicked(View view) {
}
}
Loading

0 comments on commit 39d3b9a

Please sign in to comment.