-
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
darkengine
committed
Sep 8, 2024
1 parent
af9d585
commit 5865941
Showing
7 changed files
with
111 additions
and
13 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
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,41 @@ | ||
package com.dark.androidbox.nodes; | ||
|
||
import android.content.Context; | ||
import android.graphics.Color; | ||
import android.util.AttributeSet; | ||
import android.view.LayoutInflater; | ||
import android.widget.FrameLayout; | ||
|
||
import androidx.annotation.Nullable; | ||
|
||
import com.dark.androidbox.databinding.BaseNodeBinding; | ||
|
||
public class BaseNode extends FrameLayout { | ||
|
||
BaseNodeBinding binding; | ||
|
||
public BaseNode(Context context) { | ||
super(context); | ||
init(); | ||
} | ||
|
||
public BaseNode(Context context, @Nullable AttributeSet attrs) { | ||
super(context, attrs); | ||
init(); | ||
} | ||
|
||
public BaseNode(Context context, @Nullable AttributeSet attrs, int defStyleAttr) { | ||
super(context, attrs, defStyleAttr); | ||
init(); | ||
} | ||
|
||
public BaseNode(Context context, @Nullable AttributeSet attrs, int defStyleAttr, int defStyleRes) { | ||
super(context, attrs, defStyleAttr, defStyleRes); | ||
init(); | ||
} | ||
|
||
public void init() { | ||
binding = BaseNodeBinding.inflate(LayoutInflater.from(getContext()), this, true); | ||
setBackgroundColor(Color.WHITE); | ||
} | ||
} |
37 changes: 37 additions & 0 deletions
37
app/src/main/java/com/dark/androidbox/nodes/ClassNode.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,37 @@ | ||
package com.dark.androidbox.nodes; | ||
|
||
import android.content.Context; | ||
import android.graphics.Color; | ||
import android.util.AttributeSet; | ||
import android.view.LayoutInflater; | ||
import android.view.View; | ||
import android.widget.Toast; | ||
|
||
import androidx.annotation.Nullable; | ||
|
||
import com.dark.androidbox.R; | ||
|
||
public class ClassNode extends BaseNode{ | ||
|
||
public ClassNode(Context context) { | ||
super(context); | ||
} | ||
|
||
public ClassNode(Context context, @Nullable AttributeSet attrs) { | ||
super(context, attrs); | ||
} | ||
|
||
public ClassNode(Context context, @Nullable AttributeSet attrs, int defStyleAttr) { | ||
super(context, attrs, defStyleAttr); | ||
} | ||
|
||
public ClassNode(Context context, @Nullable AttributeSet attrs, int defStyleAttr, int defStyleRes) { | ||
super(context, attrs, defStyleAttr, defStyleRes); | ||
} | ||
|
||
@Override | ||
public void init() { | ||
super.init(); | ||
setBackgroundColor(Color.GREEN); | ||
} | ||
} |
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,12 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent"> | ||
|
||
<Button | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:text="@string/app_name" | ||
android:layout_centerInParent="true"/> | ||
|
||
</RelativeLayout> |
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 |
---|---|---|
@@ -1,16 +1,17 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:id="@+id/root" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:padding="12dp" | ||
android:layout_gravity="center" | ||
android:background="@drawable/bg_node_view"> | ||
|
||
<TextView | ||
android:id="@+id/txt" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:layout_centerInParent="true" | ||
android:textSize="18sp" /> | ||
<!-- <TextView--> | ||
<!-- android:id="@+id/txt"--> | ||
<!-- android:layout_width="wrap_content"--> | ||
<!-- android:layout_height="wrap_content"--> | ||
<!-- android:layout_centerInParent="true"--> | ||
<!-- android:textSize="18sp" />--> | ||
|
||
</RelativeLayout> |