Π·Π΅ΡΠΊΠ°Π»ΠΎ ΠΈΠ· https://github.com/mozilla/Jisort.git
First round of code cleanup π§
This commit is contained in:
Π ΠΎΠ΄ΠΈΡΠ΅Π»Ρ
4a0bd8238c
ΠΠΎΠΌΠΌΠΈΡ
437634117d
|
@ -1,10 +1,8 @@
|
|||
package com.mozilla.hackathon.kiboko;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.net.Uri;
|
||||
import android.os.Environment;
|
||||
import android.util.Log;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
|
@ -16,10 +14,6 @@ import java.util.ArrayList;
|
|||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Created by secretrobotron on 7/2/16.
|
||||
*/
|
||||
|
||||
public class Analytics {
|
||||
|
||||
private static final String ANALYTICS_FILENAME = ".jisort_analytics.txt";
|
||||
|
@ -75,7 +69,7 @@ public class Analytics {
|
|||
public String toString() {
|
||||
String output = "[" + mTime.toString() + "] " + mName;
|
||||
if (mData != null) {
|
||||
output += " -> (" + mData.toString() + ")";
|
||||
output += " -> (" + mData + ")";
|
||||
}
|
||||
return output;
|
||||
}
|
||||
|
|
|
@ -6,15 +6,10 @@ import android.app.NotificationManager;
|
|||
import android.app.PendingIntent;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.IntentFilter;
|
||||
import android.support.v4.app.NotificationCompat;
|
||||
|
||||
import com.mozilla.hackathon.kiboko.activities.TutorialSlideActivity;
|
||||
import com.mozilla.hackathon.kiboko.recievers.DSOBatteryReceiver;
|
||||
|
||||
/**
|
||||
* Created by Brian Mwadime on 06/06/2016.
|
||||
*/
|
||||
public class App extends Application {
|
||||
public static String PACKAGE_NAME;
|
||||
protected static Context context = null;
|
||||
|
|
|
@ -7,9 +7,6 @@ import android.view.MenuItem;
|
|||
|
||||
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
|
||||
|
|
|
@ -31,10 +31,6 @@ import java.util.List;
|
|||
|
||||
import static com.mozilla.hackathon.kiboko.utilities.LogUtils.makeLogTag;
|
||||
|
||||
/**
|
||||
* Created by mwadime on 6/10/2016.
|
||||
*/
|
||||
|
||||
public class IconQuizActivity extends AppCompatActivity implements LoaderManager.LoaderCallbacks<Cursor> {
|
||||
private static final List<Integer> possibleIcons;
|
||||
static {
|
||||
|
|
|
@ -13,9 +13,6 @@ import com.mozilla.hackathon.kiboko.R;
|
|||
|
||||
import pl.droidsonroids.gif.GifImageView;
|
||||
|
||||
/**
|
||||
* Created by mwadime on 6/10/2016.
|
||||
*/
|
||||
public class ResultActivity extends AppCompatActivity {
|
||||
private static int[] imageResources = new int[]{
|
||||
R.drawable.bmo,
|
||||
|
@ -41,7 +38,7 @@ public class ResultActivity extends AppCompatActivity {
|
|||
|
||||
txtPoints.setText(getString(R.string.quiz_result_score, score, total));
|
||||
|
||||
Analytics.add("Icon Quiz Finished", new Integer(score).toString());
|
||||
Analytics.add("Icon Quiz Finished", Integer.toString(score));
|
||||
|
||||
GifImageView gifImageView = (GifImageView) findViewById((R.id.result_image));
|
||||
int randomIndex = new Double(Math.random() * imageResources.length).intValue();
|
||||
|
|
|
@ -1,15 +1,12 @@
|
|||
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.ActionBar;
|
||||
import android.view.MenuItem;
|
||||
|
||||
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
|
||||
|
|
|
@ -97,7 +97,7 @@ public class TutorialSlideActivity extends DSOActivity implements LoaderManager.
|
|||
mPrev.setEnabled(false);
|
||||
}
|
||||
|
||||
Analytics.add("Tutorial slide", mTopic + ", " + new Integer(mPager.getCurrentItem()).toString());
|
||||
Analytics.add("Tutorial slide", mTopic + ", " + Integer.toString(mPager.getCurrentItem()));
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -112,7 +112,7 @@ public class TutorialSlideActivity extends DSOActivity implements LoaderManager.
|
|||
mPrev.setEnabled(true);
|
||||
}
|
||||
|
||||
Analytics.add("Tutorial slide", mTopic + ", " + new Integer(mPager.getCurrentItem()).toString());
|
||||
Analytics.add("Tutorial slide", mTopic + ", " + Integer.toString(mPager.getCurrentItem()));
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
@ -8,9 +8,6 @@ import android.view.View;
|
|||
|
||||
import com.mozilla.hackathon.kiboko.R;
|
||||
|
||||
/**
|
||||
* Created by secretrobotron on 7/15/16.
|
||||
*/
|
||||
public class WelcomeActivity extends AppCompatActivity {
|
||||
|
||||
@Override
|
||||
|
|
|
@ -20,9 +20,6 @@ import java.util.List;
|
|||
|
||||
import io.github.douglasjunior.androidSimpleTooltip.SimpleTooltip;
|
||||
|
||||
/**
|
||||
* Created by Brian Mwadime on 01/06/2016.
|
||||
*/
|
||||
public class IconsAdapter extends BaseAdapter implements Filterable {
|
||||
List<IconTopic> topics;
|
||||
private Context context;
|
||||
|
|
|
@ -20,9 +20,6 @@ import com.mozilla.hackathon.kiboko.models.Topic;
|
|||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Created by Brian Mwadime on 01/06/2016.
|
||||
*/
|
||||
public class TopicsAdapter extends BaseAdapter implements Filterable {
|
||||
List<Topic> topics;
|
||||
private Context context;
|
||||
|
|
|
@ -1,8 +1,5 @@
|
|||
package com.mozilla.hackathon.kiboko.events;
|
||||
|
||||
/**
|
||||
* Created by mwadime on 6/11/2016.
|
||||
*/
|
||||
public class AirplaneModeStateChanged {
|
||||
public boolean mIsAirplaneModeStateEnabled;
|
||||
public AirplaneModeStateChanged(boolean mIsAirplaneModeStateEnabled)
|
||||
|
|
|
@ -1,8 +1,5 @@
|
|||
package com.mozilla.hackathon.kiboko.events;
|
||||
|
||||
/**
|
||||
* Created by secretrobotron on 7/1/2016.
|
||||
*/
|
||||
public class ApplicationStateChanged {
|
||||
public boolean mIsOpen;
|
||||
public ApplicationStateChanged(boolean isOpen)
|
||||
|
|
|
@ -1,8 +1,5 @@
|
|||
package com.mozilla.hackathon.kiboko.events;
|
||||
|
||||
/**
|
||||
* Created by mwadime on 6/11/2016.
|
||||
*/
|
||||
public class BatteryStateChanged {
|
||||
public boolean mIsBatteryStateEnabled;
|
||||
public BatteryStateChanged(boolean mIsBatteryStateEnabled)
|
||||
|
|
|
@ -1,8 +1,5 @@
|
|||
package com.mozilla.hackathon.kiboko.events;
|
||||
|
||||
/**
|
||||
* Created by mwadime on 6/11/2016.
|
||||
*/
|
||||
public class BluetoothStateChanged {
|
||||
public boolean mIsBluetoothStateEnabled;
|
||||
public BluetoothStateChanged(boolean mIsBluetoothStateEnabled)
|
||||
|
|
|
@ -1,8 +1,5 @@
|
|||
package com.mozilla.hackathon.kiboko.events;
|
||||
|
||||
/**
|
||||
* Created by mwadime on 6/11/2016.
|
||||
*/
|
||||
public class LocationStateChanged {
|
||||
public boolean mIsLocationEnabled;
|
||||
public LocationStateChanged(boolean mIsLocationEnabled)
|
||||
|
|
|
@ -1,8 +1,5 @@
|
|||
package com.mozilla.hackathon.kiboko.events;
|
||||
|
||||
/**
|
||||
* Created by mwadime on 6/11/2016.
|
||||
*/
|
||||
public class LowstorageStateChanged {
|
||||
public boolean mIsLowstorageStateEnabled;
|
||||
public LowstorageStateChanged(boolean mIsLowstorageStateEnabled)
|
||||
|
|
|
@ -1,8 +1,5 @@
|
|||
package com.mozilla.hackathon.kiboko.events;
|
||||
|
||||
/**
|
||||
* Created by mwadime on 6/11/2016.
|
||||
*/
|
||||
public class NetworkStateChanged
|
||||
{
|
||||
public boolean mIsInternetConnected;
|
||||
|
|
|
@ -1,7 +1,4 @@
|
|||
package com.mozilla.hackathon.kiboko.fragments;
|
||||
/**
|
||||
* Created by mwadime on 6/9/2016.
|
||||
*/
|
||||
|
||||
import android.content.res.TypedArray;
|
||||
import android.os.Bundle;
|
||||
|
|
|
@ -2,18 +2,14 @@ package com.mozilla.hackathon.kiboko.fragments;
|
|||
|
||||
import android.os.Bundle;
|
||||
import android.support.v4.app.ListFragment;
|
||||
import android.support.v7.widget.SwitchCompat;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.CompoundButton;
|
||||
import android.widget.LinearLayout;
|
||||
|
||||
import com.mozilla.hackathon.kiboko.Analytics;
|
||||
import com.mozilla.hackathon.kiboko.R;
|
||||
import com.mozilla.hackathon.kiboko.adapters.TopicsAdapter;
|
||||
import com.mozilla.hackathon.kiboko.models.Topic;
|
||||
import com.mozilla.hackathon.kiboko.settings.SettingsUtils;
|
||||
|
||||
import org.sufficientlysecure.htmltextview.EmojiUtils;
|
||||
|
||||
|
|
|
@ -5,21 +5,22 @@ import android.content.Context;
|
|||
import android.database.Cursor;
|
||||
import android.net.Uri;
|
||||
import android.provider.BaseColumns;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.JsonElement;
|
||||
import com.mozilla.hackathon.kiboko.models.Question;
|
||||
import com.mozilla.hackathon.kiboko.provider.DsoContract;
|
||||
import com.mozilla.hackathon.kiboko.provider.DsoContractHelper;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
|
||||
import static com.mozilla.hackathon.kiboko.utilities.LogUtils.LOGD;
|
||||
import static com.mozilla.hackathon.kiboko.utilities.LogUtils.LOGW;
|
||||
import static com.mozilla.hackathon.kiboko.utilities.LogUtils.makeLogTag;
|
||||
/**
|
||||
* Created by Brian Mwadime on 25/06/2016.
|
||||
*/
|
||||
|
||||
public class QuizHandler extends JSONHandler {
|
||||
private static final String TAG = makeLogTag(QuizHandler.class);
|
||||
private HashMap<String, Question> mQuiz = new HashMap<String, Question>();
|
||||
|
|
|
@ -5,22 +5,23 @@ import android.content.Context;
|
|||
import android.database.Cursor;
|
||||
import android.net.Uri;
|
||||
import android.provider.BaseColumns;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.JsonElement;
|
||||
import com.mozilla.hackathon.kiboko.models.Tutorial;
|
||||
import com.mozilla.hackathon.kiboko.provider.DsoContract;
|
||||
import com.mozilla.hackathon.kiboko.provider.DsoContract.Tutorials;
|
||||
import com.mozilla.hackathon.kiboko.provider.DsoContractHelper;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
|
||||
import static com.mozilla.hackathon.kiboko.utilities.LogUtils.LOGD;
|
||||
import static com.mozilla.hackathon.kiboko.utilities.LogUtils.LOGW;
|
||||
import static com.mozilla.hackathon.kiboko.utilities.LogUtils.makeLogTag;
|
||||
/**
|
||||
* Created by Brian Mwadime on 25/06/2016.
|
||||
*/
|
||||
|
||||
public class TutorialsHandler extends JSONHandler {
|
||||
private static final String TAG = makeLogTag(TutorialsHandler.class);
|
||||
private HashMap<String, Tutorial> mTutorials = new HashMap<String, Tutorial>();
|
||||
|
|
|
@ -2,9 +2,6 @@ package com.mozilla.hackathon.kiboko.models;
|
|||
|
||||
import com.mozilla.hackathon.kiboko.utilities.HashUtils;
|
||||
|
||||
/**
|
||||
* Created by mwadime on 6/10/2016.
|
||||
*/
|
||||
public class Question {
|
||||
public String id;
|
||||
public String question;
|
||||
|
@ -71,14 +68,13 @@ public class Question {
|
|||
}
|
||||
|
||||
public String getImportHashCode() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("id").append(id == null ? "" : id)
|
||||
.append("question").append(question == null ? "" : question)
|
||||
.append("answer").append(answer == null ? "" : answer)
|
||||
.append("optiona").append(optiona== null ? "" : optiona)
|
||||
.append("optionb").append(optionb == null ? "" : optionb)
|
||||
.append("optionc").append(optionc == null ? "" : optionc)
|
||||
.append("optiond").append(optiond == null ? "" : optiond);
|
||||
return HashUtils.computeWeakHash(sb.toString());
|
||||
String sb = "id" + (id == null ? "" : id) +
|
||||
"question" + (question == null ? "" : question) +
|
||||
"answer" + (answer == null ? "" : answer) +
|
||||
"optiona" + (optiona == null ? "" : optiona) +
|
||||
"optionb" + (optionb == null ? "" : optionb) +
|
||||
"optionc" + (optionc == null ? "" : optionc) +
|
||||
"optiond" + (optiond == null ? "" : optiond);
|
||||
return HashUtils.computeWeakHash(sb);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,18 +5,15 @@ import android.database.sqlite.SQLiteDatabase;
|
|||
import android.database.sqlite.SQLiteOpenHelper;
|
||||
import android.provider.BaseColumns;
|
||||
|
||||
import com.mozilla.hackathon.kiboko.provider.DsoContract.QuizColumns;
|
||||
import com.mozilla.hackathon.kiboko.provider.DsoContract.Tutorials;
|
||||
import com.mozilla.hackathon.kiboko.provider.DsoContract.TutorialsColumns;
|
||||
import com.mozilla.hackathon.kiboko.provider.DsoContract.QuizColumns;
|
||||
import com.mozilla.hackathon.kiboko.sync.DsoDataHandler;
|
||||
|
||||
import static com.mozilla.hackathon.kiboko.utilities.LogUtils.LOGD;
|
||||
import static com.mozilla.hackathon.kiboko.utilities.LogUtils.LOGW;
|
||||
import static com.mozilla.hackathon.kiboko.utilities.LogUtils.makeLogTag;
|
||||
|
||||
/**
|
||||
* Created by brian Mwadime on 25/06/2016.
|
||||
*/
|
||||
public class DsoDatabase extends SQLiteOpenHelper {
|
||||
private static final String TAG = makeLogTag(DsoDatabase.class);
|
||||
|
||||
|
|
|
@ -12,9 +12,9 @@ import android.net.Uri;
|
|||
import android.os.ParcelFileDescriptor;
|
||||
import android.util.Log;
|
||||
|
||||
import com.mozilla.hackathon.kiboko.provider.DsoDatabase.Tables;
|
||||
import com.mozilla.hackathon.kiboko.provider.DsoContract.Tutorials;
|
||||
import com.mozilla.hackathon.kiboko.provider.DsoContract.Quizes;
|
||||
import com.mozilla.hackathon.kiboko.provider.DsoContract.Tutorials;
|
||||
import com.mozilla.hackathon.kiboko.provider.DsoDatabase.Tables;
|
||||
import com.mozilla.hackathon.kiboko.utilities.SelectionBuilder;
|
||||
|
||||
import java.io.FileDescriptor;
|
||||
|
|
|
@ -4,9 +4,6 @@ import android.content.UriMatcher;
|
|||
import android.net.Uri;
|
||||
import android.util.SparseArray;
|
||||
|
||||
/**
|
||||
* Created by Mwadime on 26/06/2016.
|
||||
*/
|
||||
public class DsoProviderUriMatcher {
|
||||
|
||||
/**
|
||||
|
|
|
@ -7,9 +7,6 @@ import android.os.BatteryManager;
|
|||
|
||||
import com.mozilla.hackathon.kiboko.App;
|
||||
|
||||
/**
|
||||
* Created by mwadime on 6/7/2016.
|
||||
*/
|
||||
public class DSOBatteryReceiver extends BroadcastReceiver {
|
||||
@Override
|
||||
public void onReceive(Context context, Intent intent) {
|
||||
|
|
|
@ -5,9 +5,6 @@ import android.content.BroadcastReceiver;
|
|||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
|
||||
/**
|
||||
* Created by mwadime on 6/7/2016.
|
||||
*/
|
||||
public class DSOChangedBroadcastReceiver extends BroadcastReceiver {
|
||||
@Override
|
||||
public void onReceive(Context context, Intent intent) {
|
||||
|
|
|
@ -4,9 +4,6 @@ import android.content.BroadcastReceiver;
|
|||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
|
||||
/**
|
||||
* Created by mwadime on 6/7/2016.
|
||||
*/
|
||||
public class DSOLocationReceiver extends BroadcastReceiver {
|
||||
@Override
|
||||
public void onReceive(Context context, Intent intent) {
|
||||
|
|
|
@ -9,10 +9,7 @@ import android.net.NetworkInfo;
|
|||
import com.mozilla.hackathon.kiboko.App;
|
||||
import com.mozilla.hackathon.kiboko.utilities.NetworkUtils;
|
||||
|
||||
/**
|
||||
* Created by mwadime on 6/7/2016.
|
||||
*/
|
||||
public class DSONetworkStateReceiver extends BroadcastReceiver {
|
||||
public class DSONetworkStateReceiver extends BroadcastReceiver {
|
||||
@Override
|
||||
public void onReceive(Context context, Intent intent) {
|
||||
String status = NetworkUtils.getConnectivityStatusString(context);
|
||||
|
|
|
@ -6,9 +6,6 @@ import android.content.Intent;
|
|||
|
||||
import com.mozilla.hackathon.kiboko.App;
|
||||
|
||||
/**
|
||||
* Created by mwadime on 6/7/2016.
|
||||
*/
|
||||
public class DSOStorageReceiver extends BroadcastReceiver {
|
||||
@Override
|
||||
public void onReceive(Context context, Intent intent) {
|
||||
|
|
|
@ -2,9 +2,6 @@ package com.mozilla.hackathon.kiboko.utilities;
|
|||
|
||||
import java.util.Locale;
|
||||
|
||||
/**
|
||||
* Created by mwadime on 7/3/2016.
|
||||
*/
|
||||
public class HashUtils {
|
||||
public static String computeWeakHash(String string) {
|
||||
return String.format(Locale.US, "%08x%08x", string.hashCode(), string.length());
|
||||
|
|
|
@ -1,8 +1,5 @@
|
|||
package com.mozilla.hackathon.kiboko.utilities;
|
||||
|
||||
/**
|
||||
* Created by michael on 4/29/16.
|
||||
*/
|
||||
public class Helpers {
|
||||
public static String makeRestCall(String call_type){
|
||||
String response = "";
|
||||
|
|
|
@ -2,9 +2,6 @@ package com.mozilla.hackathon.kiboko.utilities;
|
|||
|
||||
import android.util.Log;
|
||||
|
||||
/**
|
||||
* Created by mwadime on 6/11/2016.
|
||||
*/
|
||||
public class LogUtils {
|
||||
private static final String LOG_PREFIX = "mozilladso_";
|
||||
private static final int LOG_PREFIX_LENGTH = LOG_PREFIX.length();
|
||||
|
|
|
@ -4,9 +4,6 @@ import android.content.Context;
|
|||
import android.net.ConnectivityManager;
|
||||
import android.net.NetworkInfo;
|
||||
|
||||
/**
|
||||
* Created by mwadime on 6/7/2016.
|
||||
*/
|
||||
public class NetworkUtils {
|
||||
|
||||
public static int TYPE_WIFI = 1;
|
||||
|
|
|
@ -1,16 +1,10 @@
|
|||
package com.mozilla.hackathon.kiboko.utilities;
|
||||
|
||||
import android.content.Context;
|
||||
import android.text.TextUtils;
|
||||
import android.text.format.DateUtils;
|
||||
|
||||
import com.mozilla.hackathon.kiboko.settings.SettingsUtils;
|
||||
|
||||
import java.text.DateFormat;
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.Formatter;
|
||||
import java.util.Locale;
|
||||
import java.util.TimeZone;
|
||||
|
||||
|
|
|
@ -3,9 +3,7 @@ package com.mozilla.hackathon.kiboko.widgets;
|
|||
import android.content.Context;
|
||||
import android.util.AttributeSet;
|
||||
import android.widget.GridView;
|
||||
/**
|
||||
* Created by mwadime on 6/12/2016.
|
||||
*/
|
||||
|
||||
public class DSOGridView extends GridView {
|
||||
public DSOGridView(Context context) {
|
||||
super(context);
|
||||
|
|
|
@ -5,10 +5,6 @@ import android.util.AttributeSet;
|
|||
import android.util.Log;
|
||||
import android.webkit.WebView;
|
||||
|
||||
/**
|
||||
* Created by Brian Mwadime on 24/06/2016.
|
||||
*/
|
||||
|
||||
/**
|
||||
* a WebView is able to do what a browser does.
|
||||
* And since the browser of Android devices using Android 2.2 + supports the animation of GIFs (at least on most devices),
|
||||
|
@ -33,11 +29,10 @@ public class GifWebView extends WebView {
|
|||
public void setGifPath(String pPath) {
|
||||
String baseUrl = pPath.substring(0, pPath.lastIndexOf("/") + 1);
|
||||
String fileName = pPath.substring(pPath.lastIndexOf("/") + 1);
|
||||
StringBuilder strBuilder = new StringBuilder();
|
||||
strBuilder.append("<html><head><style type='text/css'>body{margin:auto auto;text-align:center;} img{width:100%25;} </style>");
|
||||
strBuilder.append("</head><body>");
|
||||
strBuilder.append("<img src=\"" + fileName + "\" width=\"100%\" /></body></html>");
|
||||
String data = strBuilder.toString();
|
||||
String data =
|
||||
"<html><head><style type='text/css'>body{margin:auto auto;text-align:center;} img{width:100%25;} </style>" +
|
||||
"</head><body>" +
|
||||
"<img src=\"" + fileName + "\" width=\"100%\" /></body></html>";
|
||||
Log.d(this.getClass().getName(), "data: " + data);
|
||||
Log.d(this.getClass().getName(), "base url: " + baseUrl);
|
||||
Log.d(this.getClass().getName(), "file name: " + fileName);
|
||||
|
@ -47,11 +42,10 @@ public class GifWebView extends WebView {
|
|||
public void setGifAssetPath(String pPath) {
|
||||
String baseUrl = pPath.substring(0, pPath.lastIndexOf("/") + 1);
|
||||
String fileName = pPath.substring(pPath.lastIndexOf("/")+1);
|
||||
StringBuilder strBuilder = new StringBuilder();
|
||||
strBuilder.append("<html><head><style type='text/css'>body{margin:auto auto;text-align:center;} img{width:100%25;} </style>");
|
||||
strBuilder.append("</head><body>");
|
||||
strBuilder.append("<img src=\"" + fileName + "\" width=\"100%\" /></body></html>");
|
||||
String data = strBuilder.toString();
|
||||
String data =
|
||||
"<html><head><style type='text/css'>body{margin:auto auto;text-align:center;} img{width:100%25;} </style>" +
|
||||
"</head><body>" +
|
||||
"<img src=\"" + fileName + "\" width=\"100%\" /></body></html>";
|
||||
Log.d(this.getClass().getName(), "data: " + data);
|
||||
Log.d(this.getClass().getName(), "base url: " + baseUrl);
|
||||
Log.d(this.getClass().getName(), "file name: " + fileName);
|
||||
|
|
|
@ -2,22 +2,19 @@ package com.mozilla.hackathon.kiboko.widgets;
|
|||
|
||||
import android.content.Context;
|
||||
import android.content.res.TypedArray;
|
||||
import android.graphics.Typeface;
|
||||
import android.support.v7.widget.CardView;
|
||||
import android.text.TextUtils;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
import android.graphics.Typeface;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.mozilla.hackathon.kiboko.R;
|
||||
|
||||
import static com.mozilla.hackathon.kiboko.utilities.LogUtils.makeLogTag;
|
||||
|
||||
/**
|
||||
* Created by mwadime on 6/11/2016.
|
||||
*/
|
||||
public class MessageCardView extends CardView implements View.OnClickListener {
|
||||
private static final String TAG = makeLogTag(MessageCardView.class);
|
||||
private TextView mTitleView;
|
||||
|
|
ΠΠ°Π³ΡΡΠ·ΠΊΠ°β¦
Π‘ΡΡΠ»ΠΊΠ° Π² Π½ΠΎΠ²ΠΎΠΉ Π·Π°Π΄Π°ΡΠ΅