Skip to content

Commit

Permalink
prepare for 2.4 release, integrate hockeyapp, fix click issue on tran…
Browse files Browse the repository at this point in the history
…slation text, copy text on long click for pre-3.0 devices.
  • Loading branch information
ahmedre committed Jun 15, 2013
1 parent cc937cb commit 0016509
Show file tree
Hide file tree
Showing 8 changed files with 78 additions and 6 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,15 +75,16 @@ Open Source Projects Used

Changelog
---------
**development**
**version 2.4.0** (released 6/15/2013)

- update to german translation (thanks br Armin Supuk)
- kurdish translation (thanks br Gharib Karim)
- improvements to search
- multiple sdcard support
- tablet support (experimental)
- tablet support for reading view
- change color of text in translation view and night mode
- uyghur translation (thanks br Abduqadir Abliz)
- crash reporting to help us fix issues

**version 2.3.1** (released 4/2/2013)

Expand Down
10 changes: 6 additions & 4 deletions app/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.quran.labs.androidquran" android:versionCode="231"
android:versionName="2.3.1"
package="com.quran.labs.androidquran" android:versionCode="240"
android:versionName="2.4.0"
android:installLocation="auto">

<uses-sdk android:minSdkVersion="7" android:targetSdkVersion="14" />
Expand Down Expand Up @@ -76,6 +76,8 @@
<action android:name="com.quran.labs.androidquran.action.UPDATE_REPEAT" />
</intent-filter>
</service>

</application>

<activity android:name="net.hockeyapp.android.UpdateActivity" />

</application>
</manifest>
5 changes: 5 additions & 0 deletions app/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@
<version>${abs.version}</version>
<type>apklib</type>
</dependency>
<dependency>
<groupId>net.hockeyapp.android</groupId>
<artifactId>HockeySDK</artifactId>
<version>2.2.1</version>
</dependency>
</dependencies>
<build>
<plugins>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,11 @@
import com.quran.labs.androidquran.service.util.DefaultDownloadReceiver;
import com.quran.labs.androidquran.service.util.ServiceIntentHelper;
import com.quran.labs.androidquran.ui.QuranActivity;
import com.quran.labs.androidquran.util.ApiKeys;
import com.quran.labs.androidquran.util.QuranCrashListener;
import com.quran.labs.androidquran.util.QuranFileUtils;
import com.quran.labs.androidquran.util.QuranScreenInfo;
import net.hockeyapp.android.CrashManager;

import java.util.Date;

Expand Down Expand Up @@ -63,6 +66,11 @@ public void onCreate(Bundle savedInstanceState) {
@Override
protected void onResume(){
super.onResume();
if (Constants.CRASH_REPORTING_ENABLED){
CrashManager.register(this, ApiKeys.HOCKEY_APP_KEY,
QuranCrashListener.getInstance());
}

mIsPaused = false;
mDownloadReceiver = new DefaultDownloadReceiver(this,
QuranDownloadService.DOWNLOAD_TYPE_PAGES);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package com.quran.labs.androidquran.data;

public class Constants {
public static final boolean CRASH_REPORTING_ENABLED = false;

// Numerics
public static final int DEFAULT_NIGHT_MODE_TEXT_BRIGHTNESS = 98;
public static final int DEFAULT_TEXT_SIZE = 15;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@

public class ApiKeys {
public static final String QURAN_APP_KEY = "";
public static final String HOCKEY_APP_KEY = "";
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package com.quran.labs.androidquran.util;

import net.hockeyapp.android.CrashManagerListener;

/**
* Created by ahmedre on 6/15/13.
*/
public class QuranCrashListener extends CrashManagerListener {
private static QuranCrashListener sInstance;

public static QuranCrashListener getInstance(){
if (sInstance == null){
sInstance = new QuranCrashListener();
}
return sInstance;
}

@Override
public Boolean onCrashesFound() {
// automatically send crashes
return true;
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package com.quran.labs.androidquran.widgets;

import android.app.Service;
import android.text.ClipboardManager;
import android.content.Context;
import android.content.res.Resources;
import android.graphics.Color;
Expand All @@ -15,6 +17,7 @@
import android.widget.LinearLayout;
import android.widget.ScrollView;
import android.widget.TextView;
import android.widget.Toast;
import com.quran.labs.androidquran.R;
import com.quran.labs.androidquran.common.QuranAyah;
import com.quran.labs.androidquran.data.QuranInfo;
Expand Down Expand Up @@ -163,6 +166,29 @@ public void highlightAyah(int ayahId){
else { mLastHighlightedAyah = -1; }
}

private OnClickListener mOnAyahClickListener = new OnClickListener() {
@Override
public void onClick(View v) {
if (mTranslationClickedListener != null){
mTranslationClickedListener.onTranslationClicked();
}
}
};

private OnLongClickListener mOnCopyAyahListener = new OnLongClickListener(){
@Override
public boolean onLongClick(View v) {
if (v instanceof TextView){
ClipboardManager mgr = (ClipboardManager)mContext.
getSystemService(Service.CLIPBOARD_SERVICE);
mgr.setText(((TextView)v).getText());
Toast.makeText(mContext, R.string.ayah_copied_popup,
Toast.LENGTH_SHORT).show();
}
return true;
}
};

private void addTextForAyah(QuranAyah ayah){
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(
LayoutParams.MATCH_PARENT,
Expand All @@ -181,6 +207,7 @@ private void addTextForAyah(QuranAyah ayah){
TextView ayahView = new TextView(mContext);
ayahView.setId(
QuranInfo.getAyahId(ayah.getSura(), ayah.getAyah()));
ayahView.setOnClickListener(mOnAyahClickListener);

ayahView.setTextAppearance(mContext, mTextStyle);
if (mIsNightMode){ ayahView.setTextColor(mNightModeTextColor); }
Expand Down Expand Up @@ -242,6 +269,9 @@ private void addTextForAyah(QuranAyah ayah){
if (Build.VERSION.SDK_INT >= 11){
ayahView.setTextIsSelectable(true);
}
else {
ayahView.setOnLongClickListener(mOnCopyAyahListener);
}

mLinearLayout.addView(ayahView, params);
}
Expand Down

0 comments on commit 0016509

Please sign in to comment.