-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9e9339a
commit 73967f7
Showing
15 changed files
with
321 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"nuxt.isNuxtApp": false | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
[ | ||
{ | ||
"Name": "Free Sound - Sound Attribution", | ||
"Path": "attribution/free_sound_attribution.json" | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
S: Keyboard Key by AntoineRomo | License: Attribution 3.0 | Timestamp: 2024-02-03 14:33:44.475509 | ||
|
||
S: Enter Key Press Mechanical Keyboard by alpinemesh | License: Creative Commons 0 | Timestamp: 2024-02-03 14:29:28.512802 |
79 changes: 79 additions & 0 deletions
79
app/src/main/java/com/block/web/builder/ui/activities/LicenseActivity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
package com.block.web.builder.ui.activities; | ||
|
||
import android.code.editor.common.utils.FileUtils; | ||
import android.os.Bundle; | ||
import android.widget.Toast; | ||
import androidx.recyclerview.widget.LinearLayoutManager; | ||
import com.block.web.builder.R; | ||
import com.block.web.builder.databinding.ActivityLicenseBinding; | ||
import com.block.web.builder.ui.adapters.LicenseListAdapter; | ||
import java.util.ArrayList; | ||
import org.json.JSONArray; | ||
import org.json.JSONException; | ||
|
||
public class LicenseActivity extends BaseActivity { | ||
private ActivityLicenseBinding binding; | ||
private ArrayList<License> LicenseList; | ||
|
||
@Override | ||
protected void onCreate(Bundle savedInstanceState) { | ||
super.onCreate(savedInstanceState); | ||
|
||
binding = ActivityLicenseBinding.inflate(getLayoutInflater()); | ||
setContentView(binding.getRoot()); | ||
|
||
binding.toolbar.setTitle(R.string.app_name); | ||
setSupportActionBar(binding.toolbar); | ||
getSupportActionBar().setDisplayHomeAsUpEnabled(true); | ||
getSupportActionBar().setHomeButtonEnabled(true); | ||
binding.toolbar.setNavigationOnClickListener( | ||
view -> { | ||
onBackPressed(); | ||
}); | ||
|
||
String LicenseListFileText = FileUtils.readFileFromAssets(getAssets(), "LicenseList.json"); | ||
LicenseList = new ArrayList<License>(); | ||
|
||
try { | ||
JSONArray arr = new JSONArray(LicenseListFileText); | ||
for (int pos = 0; pos < arr.length(); ++pos) { | ||
if (arr.getJSONObject(pos).has("Name") && arr.getJSONObject(pos).has("Path")) { | ||
License License = new License(); | ||
License.setLicenseName(arr.getJSONObject(pos).getString("Name")); | ||
License.setLicensePath(arr.getJSONObject(pos).getString("Path")); | ||
LicenseList.add(License); | ||
} | ||
} | ||
} catch (JSONException e) { | ||
} | ||
binding.list.setAdapter(new LicenseListAdapter(LicenseList, this)); | ||
binding.list.setLayoutManager(new LinearLayoutManager(this)); | ||
} | ||
|
||
@Override | ||
protected void onDestroy() { | ||
super.onDestroy(); | ||
binding = null; | ||
} | ||
|
||
public class License { | ||
private String LicenseName; | ||
private String LicensePath; | ||
|
||
public String getLicenseName() { | ||
return this.LicenseName; | ||
} | ||
|
||
public void setLicenseName(String LicenseName) { | ||
this.LicenseName = LicenseName; | ||
} | ||
|
||
public String getLicensePath() { | ||
return this.LicensePath; | ||
} | ||
|
||
public void setLicensePath(String LicensePath) { | ||
this.LicensePath = LicensePath; | ||
} | ||
} | ||
} |
38 changes: 38 additions & 0 deletions
38
app/src/main/java/com/block/web/builder/ui/activities/LicenseReaderActivity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
package com.block.web.builder.ui.activities; | ||
|
||
import android.code.editor.common.utils.FileUtils; | ||
import android.os.Bundle; | ||
import android.text.method.LinkMovementMethod; | ||
import android.text.util.Linkify; | ||
import com.block.web.builder.R; | ||
import com.block.web.builder.databinding.ActivityLicenseReaderBinding; | ||
|
||
public class LicenseReaderActivity extends BaseActivity { | ||
private ActivityLicenseReaderBinding binding; | ||
|
||
@Override | ||
protected void onCreate(Bundle savedInstanceState) { | ||
super.onCreate(savedInstanceState); | ||
|
||
binding = ActivityLicenseReaderBinding.inflate(getLayoutInflater()); | ||
// set content view to binding's root. | ||
setContentView(binding.getRoot()); | ||
|
||
binding.toolbar.setTitle(R.string.app_name); | ||
setSupportActionBar(binding.toolbar); | ||
getSupportActionBar().setDisplayHomeAsUpEnabled(true); | ||
getSupportActionBar().setHomeButtonEnabled(true); | ||
binding.toolbar.setNavigationOnClickListener(v -> onBackPressed()); | ||
|
||
binding.LicenseText.setAutoLinkMask(Linkify.WEB_URLS); | ||
binding.LicenseText.setMovementMethod(LinkMovementMethod.getInstance()); | ||
binding.LicenseText.setText( | ||
FileUtils.readFileFromAssets(getAssets(), getIntent().getStringExtra("Path"))); | ||
} | ||
|
||
@Override | ||
protected void onDestroy() { | ||
super.onDestroy(); | ||
binding = null; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
58 changes: 58 additions & 0 deletions
58
app/src/main/java/com/block/web/builder/ui/adapters/LicenseListAdapter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
package com.block.web.builder.ui.adapters; | ||
|
||
import android.app.Activity; | ||
import android.content.Intent; | ||
import android.view.View; | ||
import android.view.ViewGroup; | ||
import androidx.recyclerview.widget.RecyclerView; | ||
import com.block.web.builder.databinding.LayoutLicenseListItemBinding; | ||
import com.block.web.builder.ui.activities.LicenseActivity; | ||
import com.block.web.builder.ui.activities.LicenseReaderActivity; | ||
import java.util.ArrayList; | ||
|
||
public class LicenseListAdapter extends RecyclerView.Adapter<LicenseListAdapter.ViewHolder> { | ||
|
||
private ArrayList<LicenseActivity.License> LicenseList; | ||
private Activity activity; | ||
|
||
public LicenseListAdapter(ArrayList<LicenseActivity.License> LicenseList, Activity activity) { | ||
this.LicenseList = LicenseList; | ||
this.activity = activity; | ||
} | ||
|
||
@Override | ||
public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { | ||
LayoutLicenseListItemBinding item = | ||
LayoutLicenseListItemBinding.inflate(activity.getLayoutInflater()); | ||
View _v = item.getRoot(); | ||
RecyclerView.LayoutParams _lp = | ||
new RecyclerView.LayoutParams( | ||
ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT); | ||
_v.setLayoutParams(_lp); | ||
return new ViewHolder(_v); | ||
} | ||
|
||
@Override | ||
public void onBindViewHolder(ViewHolder _holder, final int _position) { | ||
LayoutLicenseListItemBinding binding = LayoutLicenseListItemBinding.bind(_holder.itemView); | ||
binding.name.setText(LicenseList.get(_position).getLicenseName()); | ||
binding.name.setOnClickListener( | ||
v -> { | ||
Intent LicenseReader = new Intent(); | ||
LicenseReader.setClass(activity, LicenseReaderActivity.class); | ||
LicenseReader.putExtra("Path", LicenseList.get(_position).getLicensePath()); | ||
activity.startActivity(LicenseReader); | ||
}); | ||
} | ||
|
||
@Override | ||
public int getItemCount() { | ||
return LicenseList.size(); | ||
} | ||
|
||
public class ViewHolder extends RecyclerView.ViewHolder { | ||
public ViewHolder(View v) { | ||
super(v); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<vector | ||
xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:height="24dp" | ||
android:width="24dp" | ||
android:viewportWidth="24" | ||
android:viewportHeight="24"> | ||
<path | ||
android:fillColor="#000000" | ||
android:pathData="M13,9H18.5L13,3.5V9M6,2H14L20,8V20A2,2 0 0,1 18,22H6C4.89,22 4,21.1 4,20V4C4,2.89 4.89,2 6,2M15,18V16H6V18H15M18,14V12H6V14H18Z" /> | ||
</vector> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<LinearLayout | ||
xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:app="http://schemas.android.com/apk/res-auto" | ||
android:layout_height="match_parent" | ||
android:layout_width="match_parent" | ||
android:orientation="vertical"> | ||
|
||
<com.google.android.material.appbar.AppBarLayout | ||
android:layout_height="wrap_content" | ||
android:layout_width="match_parent" | ||
android:id="@+id/appbar"> | ||
|
||
<com.google.android.material.appbar.MaterialToolbar | ||
android:layout_height="?attr/actionBarSize" | ||
android:layout_width="match_parent" | ||
android:id="@+id/toolbar" /> | ||
|
||
</com.google.android.material.appbar.AppBarLayout> | ||
|
||
<androidx.core.widget.NestedScrollView | ||
android:layout_height="match_parent" | ||
android:layout_width="match_parent" | ||
app:layout_behavior="com.google.android.material.appbar.AppBarLayout$ScrollingViewBehavior" | ||
android:id="@+id/nested_scroll_view"> | ||
|
||
<androidx.recyclerview.widget.RecyclerView | ||
android:layout_height="match_parent" | ||
android:layout_width="match_parent" | ||
android:id="@+id/list" /> | ||
|
||
</androidx.core.widget.NestedScrollView> | ||
|
||
</LinearLayout> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<LinearLayout | ||
xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:app="http://schemas.android.com/apk/res-auto" | ||
android:layout_height="match_parent" | ||
android:layout_width="match_parent" | ||
android:orientation="vertical"> | ||
|
||
<com.google.android.material.appbar.AppBarLayout | ||
android:layout_height="wrap_content" | ||
android:layout_width="match_parent" | ||
app:layout_behavior="com.google.android.material.appbar.AppBarLayout$Behavior" | ||
android:id="@+id/appbar"> | ||
|
||
<com.google.android.material.appbar.MaterialToolbar | ||
android:layout_height="?attr/actionBarSize" | ||
android:layout_width="match_parent" | ||
android:id="@+id/toolbar" /> | ||
|
||
</com.google.android.material.appbar.AppBarLayout> | ||
|
||
<androidx.core.widget.NestedScrollView | ||
android:layout_height="match_parent" | ||
android:layout_width="match_parent" | ||
app:layout_behavior="com.google.android.material.appbar.AppBarLayout$ScrollingViewBehavior" | ||
android:id="@+id/nested_scroll_view"> | ||
|
||
<LinearLayout | ||
android:layout_height="wrap_content" | ||
android:layout_width="wrap_content" | ||
android:orientation="vertical"> | ||
|
||
<TextView | ||
android:layout_height="wrap_content" | ||
android:layout_width="match_parent" | ||
android:id="@+id/LicenseText" /> | ||
|
||
</LinearLayout> | ||
|
||
</androidx.core.widget.NestedScrollView> | ||
|
||
</LinearLayout> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<LinearLayout | ||
xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:layout_height="wrap_content" | ||
android:layout_width="match_parent" | ||
android:orientation="vertical"> | ||
|
||
<LinearLayout | ||
android:layout_height="wrap_content" | ||
android:layout_width="match_parent" | ||
android:padding="16dp"> | ||
|
||
<TextView | ||
android:layout_height="wrap_content" | ||
android:layout_width="wrap_content" | ||
android:textSize="18sp" | ||
android:id="@+id/name" | ||
android:text="License" /> | ||
|
||
</LinearLayout> | ||
|
||
<View | ||
android:layout_height="1dp" | ||
android:layout_width="match_parent" | ||
android:background="?attr/colorOnSurface" /> | ||
|
||
</LinearLayout> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.