();
34 | extras.put("color_bg", "000000");
35 | extras.put("color_text", "FFFFFF");
36 | AdRequest adRequest = new AdRequest();
37 | adRequest.setExtras(extras);
38 | ad.loadAd(adRequest);
39 | } else {
40 | ad.setEnabled(false);
41 | }
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/src/com/intervigil/lame/helper/DialogHelper.java:
--------------------------------------------------------------------------------
1 | /* DialogHelper.java
2 |
3 | Copyright (c) 2010 Ethan Chen
4 |
5 | This program is free software; you can redistribute it and/or modify
6 | it under the terms of the GNU General Public License as published by
7 | the Free Software Foundation; either version 2 of the License, or
8 | (at your option) any later version.
9 |
10 | This program is distributed in the hope that it will be useful,
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | GNU General Public License for more details.
14 |
15 | You should have received a copy of the GNU General Public License along
16 | with this program; if not, write to the Free Software Foundation, Inc.,
17 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18 | */
19 |
20 | package com.intervigil.lame.helper;
21 |
22 | import android.app.AlertDialog;
23 | import android.content.Context;
24 | import android.content.DialogInterface;
25 |
26 | public class DialogHelper {
27 |
28 | public static void showWarning(Context context, int titleId, int warningId) {
29 | AlertDialog.Builder warningBuilder = new AlertDialog.Builder(context);
30 | warningBuilder.setMessage(context.getString(warningId)).setTitle(
31 | context.getString(titleId)).setCancelable(false)
32 | .setPositiveButton("Ok", new DialogInterface.OnClickListener() {
33 | public void onClick(DialogInterface dialog, int id) {
34 | dialog.dismiss();
35 | }
36 | });
37 | warningBuilder.create().show();
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/src/com/intervigil/lame/helper/PreferenceHelper.java:
--------------------------------------------------------------------------------
1 | /* PreferenceHelper.java
2 | A port of LAME for Android
3 |
4 | Copyright (c) 2010 Ethan Chen
5 |
6 | This library is free software; you can redistribute it and/or
7 | modify it under the terms of the GNU Lesser General Public
8 | License as published by the Free Software Foundation; either
9 | version 2 of the License, or (at your option) any later version.
10 |
11 | This library is distributed in the hope that it will be useful,
12 | but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 | Lesser General Public License for more details.
15 |
16 | You should have received a copy of the GNU Lesser General Public
17 | License along with this library; if not, write to the Free Software
18 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 | */
20 |
21 | package com.intervigil.lame.helper;
22 |
23 | import android.content.Context;
24 | import android.content.SharedPreferences;
25 | import android.preference.PreferenceManager;
26 |
27 | import com.intervigil.lame.R;
28 |
29 | public class PreferenceHelper {
30 |
31 | public static boolean getShowAds(Context context) {
32 | SharedPreferences prefReader = PreferenceManager
33 | .getDefaultSharedPreferences(context);
34 | boolean pref = prefReader.getBoolean(context
35 | .getString(R.string.prefs_enable_ads_key), Boolean
36 | .parseBoolean(context
37 | .getString(R.string.prefs_enable_ads_default)));
38 | return pref;
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/src/com/intervigil/lame/intents/FileManagerIntents.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2008 OpenIntents.org
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | /**
18 | * Provides OpenIntents actions, extras, and categories used by providers.
19 | * These specifiers extend the standard Android specifiers.
20 | */
21 |
22 | package com.intervigil.lame.intents;
23 |
24 | public final class FileManagerIntents {
25 | /**
26 | * Activity Action: Pick a file through the file manager, or let user
27 | * specify a custom file name. Data is the current file name or file name
28 | * suggestion. Returns a new file name as file URI in data.
29 | *
30 | *
31 | * Constant Value: "org.openintents.action.PICK_FILE"
32 | *
33 | */
34 | public static final String ACTION_PICK_FILE = "org.openintents.action.PICK_FILE";
35 |
36 | /**
37 | * Activity Action: Pick a directory through the file manager, or let user
38 | * specify a custom file name. Data is the current directory name or
39 | * directory name suggestion. Returns a new directory name as file URI in
40 | * data.
41 | *
42 | *
43 | * Constant Value: "org.openintents.action.PICK_DIRECTORY"
44 | *
45 | */
46 | public static final String ACTION_PICK_DIRECTORY = "org.openintents.action.PICK_DIRECTORY";
47 |
48 | /**
49 | * The title to display.
50 | *
51 | *
52 | * This is shown in the title bar of the file manager.
53 | *
54 | *
55 | *
56 | * Constant Value: "org.openintents.extra.TITLE"
57 | *
58 | */
59 | public static final String EXTRA_TITLE = "org.openintents.extra.TITLE";
60 |
61 | /**
62 | * The text on the button to display.
63 | *
64 | *
65 | * Depending on the use, it makes sense to set this to "Open" or "Save".
66 | *
67 | *
68 | *
69 | * Constant Value: "org.openintents.extra.BUTTON_TEXT"
70 | *
71 | */
72 | public static final String EXTRA_BUTTON_TEXT = "org.openintents.extra.BUTTON_TEXT";
73 | }
74 |
--------------------------------------------------------------------------------
/zipalign-apk.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | zipalign -v 4 Lame4Android.apk Lame4Android-aligned.apk
4 | mv Lame4Android-aligned.apk Lame4Android.apk
5 |
--------------------------------------------------------------------------------