Skip to content

Commit

Permalink
minor bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Shaji Khan committed Jun 23, 2024
1 parent 54d375b commit 6b27f37
Show file tree
Hide file tree
Showing 12 changed files with 73 additions and 20 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ android {
applicationId "com.shajikhan.ladspa.amprack"
minSdk 24
targetSdk 33
versionCode 99
versionName '4.41'
versionCode 101
versionName '4.51'

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
externalNativeBuild {
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/assets/plugins.json
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@
6017,6034,1195,
1913,1413,2145,1206
],
"Gate": [
"Noise Gate": [
5020,
1410,2602, 8019
],
Expand Down
5 changes: 5 additions & 0 deletions app/src/main/cpp/Engine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,11 @@ void Engine::addPluginToRackLazy(char* library, int pluginIndex, SharedLibrary::
sharedLibrary ->setLibraryPath(LIBRARY_PATH);
sharedLibrary->load();

if (sharedLibrary->descriptors.size() == 0) {
LOGE("Unable to load shared library!") ;
return;
}

LOGD("loaded shared library [ok] ... now trying to load plugin");
Plugin * plugin = new Plugin (sharedLibrary->descriptors.at(pluginIndex), (long) mSampleRate, _type);
plugin->sharedLibrary = sharedLibrary;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -914,6 +914,9 @@ public void onBillingSetupFinished(@NonNull BillingResult billingResult) {
if (BuildConfig.BUILD_TYPE.equals("debug")) {
proVersion = true ;
}

// proVersion = false;
// defaultSharedPreferences.edit().putBoolean("pro", false).apply();
}

void showMediaPlayerDialog() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ protected void onCreate(Bundle savedInstanceState) {
setContentView(R.layout.activity_purchase2);
TextView priceView = findViewById(R.id.price);
context = this;

TextView oldPrice = findViewById(R.id.old_price);
oldPrice.setPaintFlags(oldPrice.getPaintFlags() | Paint.STRIKE_THRU_TEXT_FLAG);
getSupportActionBar().hide();
Expand Down
25 changes: 18 additions & 7 deletions app/src/main/java/com/shajikhan/ladspa/amprack/Rack.java
Original file line number Diff line number Diff line change
Expand Up @@ -395,9 +395,9 @@ public void onCheckedChanged(CompoundButton compoundButton, boolean b) {
public void onClick(View view) {
if (mainActivity.dataAdapter.plugins.size() > 1 && MainActivity.proVersion == false) {
Log.w(TAG, "onClick: " + String.format("already %d plugins in queue", mainActivity.dataAdapter.plugins.size()));
Intent intent = new Intent(mainActivity, Purchase.class);
startActivity(intent);
return;
// Intent intent = new Intent(mainActivity, Purchase.class);
// startActivity(intent);
// return;
}

// linearLayout.setBackground();
Expand Down Expand Up @@ -535,15 +535,26 @@ public boolean onTouch(View view, MotionEvent motionEvent) {
optionsMenu.getMenuInflater().inflate(R.menu.options_menu, optionsMenu.getMenu());

FirebaseUser user = FirebaseAuth.getInstance().getCurrentUser() ;
MenuItem settings = optionsMenu.getMenu().getItem(0);
MenuItem logout = optionsMenu.getMenu().getItem(1);
MenuItem debug = optionsMenu.getMenu().getItem(2);
MenuItem getPro = optionsMenu.getMenu().getItem(3);
MenuItem settings = optionsMenu.getMenu().findItem(R.id.settings_menu_item);
MenuItem logout = optionsMenu.getMenu().findItem(R.id.logout_menu_item);
MenuItem debug = optionsMenu.getMenu().findItem(R.id.debug_menu_item);
MenuItem getPro = optionsMenu.getMenu().findItem(R.id.get_pro);
if (mainActivity.defaultSharedPreferences.getBoolean("pro", false)) {
getPro.setVisible(false);
TextView textView = view.findViewById(R.id.app_main_title);
textView.setText("Pro");
(view.findViewById(R.id.pro_label)).setVisibility(View.VISIBLE);
} else {
TextView proLabel = view.findViewById(R.id.pro_label);
proLabel.setVisibility(View.VISIBLE);
proLabel.setEnabled(true);
proLabel.setText("Get Pro");
proLabel.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
startActivity(new Intent(mainActivity, Purchase.class));
}
});
}

getPro.setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,22 @@ public static class HeaderFragment extends PreferenceFragmentCompat {
@Override
public void onCreatePreferences(Bundle savedInstanceState, String rootKey) {
setPreferencesFromResource(R.xml.header_preferences, rootKey);

Preference purchase = findPreference("purchase_pro");
purchase.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() {
@Override
public boolean onPreferenceClick(Preference preference) {
startActivity(new Intent(getContext(), Purchase.class));
return false;
}
});

if (! PreferenceManager.getDefaultSharedPreferences(getContext()).getBoolean("pro", false)) {
purchase.setVisible(true);
}

Log.d("SETTINGS", String.format ("[pro version]: %b", PreferenceManager.getDefaultSharedPreferences(getContext()).getBoolean("pro", false)));

Preference privacy = findPreference("privacy_policy") ;
privacy.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() {
@Override
Expand Down Expand Up @@ -140,10 +156,6 @@ public void onCreatePreferences(Bundle savedInstanceState, String rootKey) {
ListPreference listPreference = findPreference("input");
ListPreference listPreferenceOutput = findPreference("output");

Preference purchase = findPreference("purchase_pro");
if (! MainActivity.proVersion)
purchase.setVisible(true);

ArrayList<CharSequence> entries = new ArrayList<>();
ArrayList<CharSequence> entryValues = new ArrayList<>();
SettingsActivity settingsActivity = (SettingsActivity) getActivity();
Expand Down
5 changes: 5 additions & 0 deletions app/src/main/res/drawable/baseline_close_24.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:height="24dp" android:tint="#FFFFFF" android:viewportHeight="24" android:viewportWidth="24" android:width="24dp">

<path android:fillColor="@android:color/white" android:pathData="M19,6.41L17.59,5 12,10.59 6.41,5 5,6.41 10.59,12 5,17.59 6.41,19 12,13.41 17.59,19 19,17.59 13.41,12z"/>

</vector>
14 changes: 13 additions & 1 deletion app/src/main/res/layout/activity_purchase2.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,24 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
app:layout_constraintRight_toRightOf="parent"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Press back button to close"
android:id="@+id/close"
android:layout_gravity="center"
app:layout_constraintTop_toTopOf="parent"
android:background="@drawable/rounded_corners_transparent"
android:layout_margin="20dp"
android:padding="10dp"
android:drawableRight="@drawable/ic_baseline_close_24"/>

<LinearLayout
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
android:layout_width="match_parent"
android:layout_marginTop="100dp"
android:layout_marginTop="4dp"
android:layout_height="wrap_content"
android:orientation="vertical">
<ImageView
Expand Down
10 changes: 5 additions & 5 deletions app/src/main/res/menu/options_menu.xml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<item android:id="@+id/settings_menu_item"
android:title="Settings"/>
<item android:id="@+id/get_pro"
android:title="Get Full Version"
android:icon="@drawable/ic_baseline_cloud_upload_24"/>

<item android:id="@+id/logout_menu_item"
android:title="Log out"/>
<item android:id="@+id/settings_menu_item"
android:title="Settings"/>
<item android:id="@+id/debug_menu_item"
android:title="Clear Queue"/>
<item android:id="@+id/get_pro"
android:title="Get Full Version"
android:icon="@drawable/ic_baseline_cloud_upload_24"/>

<item android:id="@+id/connect_guitar_menu"
android:title="Connect Guitar"/>
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<string name="build_id">635</string>
<string name="variant">Turbocharged version</string>
<string name="quote">Powered by Rock and Roll</string>
<string name="copyright">All trademarks are copyrights of their respective owners and do not represent affiliation or endorsement.</string>
<string name="onboard_description">
[new] Video Recorder\n\n
Welcome to Version 4: \n\n
Expand Down
3 changes: 3 additions & 0 deletions app/src/main/res/xml/header_preferences.xml
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,7 @@
android:icon="@drawable/baseline_auto_graph_24"
android:title="@string/variant"
android:summary="@string/quote"/>
<Preference
app:key="disclaimer"
android:summary="@string/copyright"/>
</PreferenceScreen>

0 comments on commit 6b27f37

Please sign in to comment.