Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: innoflash/iOSViews
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v1.0.3
Choose a base ref
...
head repository: innoflash/iOSViews
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
  • 5 commits
  • 8 files changed
  • 1 contributor

Commits on Oct 11, 2019

  1. Copy the full SHA
    9630621 View commit details
  2. fixed image padding

    innoflash committed Oct 11, 2019
    Copy the full SHA
    1d68935 View commit details
  3. fixed padding format

    innoflash committed Oct 11, 2019
    Copy the full SHA
    b8eaf26 View commit details

Commits on Oct 12, 2019

  1. fixed list item view line

    innoflash committed Oct 12, 2019
    Copy the full SHA
    76284ab View commit details
  2. added full screen dialog

    innoflash committed Oct 12, 2019
    Copy the full SHA
    6b8527d View commit details
38 changes: 31 additions & 7 deletions app/src/main/res/layout/activity_liv1.xml
Original file line number Diff line number Diff line change
@@ -40,14 +40,38 @@
<androidx.cardview.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content">

<net.innoflash.iosview.lists.ListItemView
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:liv_has_image="true"
app:liv_text_color="@color/ios_red"
app:liv_icon_padding="@dimen/chip_text_size"
app:liv_text="@string/app_name" />
android:orientation="vertical"
android:layout_height="wrap_content">

<net.innoflash.iosview.lists.ListItemView
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:liv_has_image="true"
app:liv_text_color="@color/ios_red"
app:liv_icon_padding="@dimen/chip_text_size"
app:liv_text="@string/app_name" />

<net.innoflash.iosview.lists.ListItemView
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:liv_has_image="true"
app:liv_text_color="@color/ios_red"
app:liv_text="@string/app_name" />

<net.innoflash.iosview.lists.ListItemView
android:id="@+id/reviews"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:scaleType="centerInside"
app:liv_circular_image="false"
app:liv_has_image="true"
app:liv_icon_padding="16sp"
app:liv_has_line="false"
app:liv_icon="@drawable/smiling"
app:liv_text="@string/app_name" />
</LinearLayout>
</androidx.cardview.widget.CardView>


77 changes: 77 additions & 0 deletions iosview/src/main/java/net/innoflash/iosview/DialogFullScreen.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
package net.innoflash.iosview;

import android.app.Dialog;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.DialogFragment;

public abstract class DialogFullScreen extends DialogFragment {

private View parentView;
private View view;
private TextView closeDialog;
private TextView dialogTitle;
private LinearLayout dialogView;
private String title;

@Nullable
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
parentView = inflater.inflate(R.layout.full_dialog_interface, container);
closeDialog = parentView.findViewById(R.id.ios_dialog_close);
dialogTitle = parentView.findViewById(R.id.ios_dialog_title);
dialogView = parentView.findViewById(R.id.ios_dialog_view);

closeDialog.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
dismiss();
}
});
return parentView;
}

@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setStyle(DialogFragment.STYLE_NORMAL, R.style.FullScreenDialogStyle);
}

@Override
public void onStart() {
super.onStart();
Dialog dialog = getDialog();
if (dialog != null) {
int width = ViewGroup.LayoutParams.MATCH_PARENT;
int height = ViewGroup.LayoutParams.MATCH_PARENT;
dialog.getWindow().setLayout(width, height);
}
}

public String getTitle() {
return title;
}

public void setTitle(String title) {
this.title = title;
dialogTitle.setText(title);
}

public View getDialogView(int layoutFile, String dialogTitle) {
view = getLayoutInflater().inflate(layoutFile, dialogView, false);
setTitle(dialogTitle);
return view;
}

public void setDialogView(View view, String title) {
dialogView.addView(view);
setTitle(title);
}

}
Original file line number Diff line number Diff line change
@@ -73,6 +73,7 @@ public int getIconPadding() {
public void setIconPadding(int iconPadding) {
this.iconPadding = iconPadding;
getCircleImageView().setPadding(iconPadding, iconPadding, iconPadding, iconPadding);
imageView.setPadding(iconPadding, iconPadding, iconPadding, iconPadding);
}

public ImageView getImageView() {
@@ -164,9 +165,9 @@ public void setCircularImage(boolean circularImage) {
this.circularImage = circularImage;
if (circularImage) {
getCircleImageView().setVisibility(VISIBLE);
getImageView().setVisibility(GONE);
imageView.setVisibility(GONE);
} else {
getImageView().setVisibility(VISIBLE);
imageView.setVisibility(VISIBLE);
getCircleImageView().setVisibility(GONE);
}
}
Original file line number Diff line number Diff line change
@@ -29,6 +29,7 @@ public class ListItemView2 extends RelativeLayout {
private int headerColor;
private int contentColor;
private int scaleType;
private int imagePadding;

public ListItemView2(Context context) {
super(context);
@@ -54,6 +55,7 @@ private void readAttributes(TypedArray typedArray) {
setHeaderColor(typedArray.getColor(R.styleable.ListItemView2_liv2_header_color, getResources().getColor(R.color.black)));
setContentColor(typedArray.getColor(R.styleable.ListItemView2_liv2_content_color, getResources().getColor(R.color.black)));
setCircularImage(typedArray.getBoolean(R.styleable.ListItemView2_liv2_circular_image, false));
setImagePadding(typedArray.getDimensionPixelSize(R.styleable.ListItemView2_liv2_icon_padding, 0));
}

private void init() {
@@ -108,6 +110,16 @@ public void setHeader(String header) {
getHeaderTextView().setText(header);
}

public int getImagePadding() {
return imagePadding;
}

public void setImagePadding(int imagePadding) {
this.imagePadding = imagePadding;
getCircleImageView().setPadding(imagePadding, imagePadding, imagePadding, imagePadding);
imageView.setPadding(imagePadding, imagePadding, imagePadding, imagePadding);
}

public void setContent(String content) {
this.content = content;
getContentTextView().setText(content);
Original file line number Diff line number Diff line change
@@ -34,6 +34,7 @@ public class ListItemView3 extends LinearLayout {
private int icon;
private int headerColor;
private int contentColor;
private int imagePadding;
private boolean hasType;
private boolean circularImage;

@@ -66,6 +67,7 @@ private void readAttributes(TypedArray typedArray) {
setBadge(typedArray.getString(R.styleable.ListItemView3_item_badge));
setItemType(ItemType.values()[typedArray.getInt(R.styleable.ListItemView3_item_type, 0)]);
setCircularImage(typedArray.getBoolean(R.styleable.ListItemView3_item_circular_image, true));
setImagePadding(typedArray.getDimensionPixelSize(R.styleable.ListItemView3_item_icon_padding, 0));
}

private void init() {
@@ -153,6 +155,16 @@ public void setItemHeading(String itemHeading) {
getHeadingTextView().setText(itemHeading);
}

public int getImagePadding() {
return imagePadding;
}

public void setImagePadding(int imagePadding) {
this.imagePadding = imagePadding;
circleImageView.setPadding(imagePadding, imagePadding, imagePadding, imagePadding);
imageView.setPadding(imagePadding, imagePadding, imagePadding, imagePadding);
}

public void setItemContent(String itemContent) {
this.itemContent = itemContent;
getContentTextView().setText("| " + itemContent);
47 changes: 47 additions & 0 deletions iosview/src/main/res/layout/full_dialog_interface.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<?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"
android:background="@color/ios_background"
android:orientation="vertical">

<LinearLayout
android:layout_width="match_parent"
android:orientation="vertical"
android:id="@+id/ios_dialog_view"
android:layout_above="@+id/toolbar"
android:layout_height="match_parent">

</LinearLayout>

<RelativeLayout
android:id="@+id/toolbar"
style="@style/bottom_toolbar"
android:layout_width="match_parent"
android:layout_height="@dimen/toolbar_height"
android:layout_alignParentBottom="true">

<TextView
android:id="@+id/ios_dialog_title"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:gravity="center"
android:text="@string/loading"
android:textSize="@dimen/toolbar_text_height"/>

<TextView
android:id="@+id/ios_dialog_close"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:gravity="center"
android:text="@string/close"
android:textColor="@color/ios_blue"
android:textFontWeight="500"
android:textSize="@dimen/toolbar_text_height"/>

</RelativeLayout>


</RelativeLayout>
15 changes: 7 additions & 8 deletions iosview/src/main/res/layout/ios_list_item_1.xml
Original file line number Diff line number Diff line change
@@ -49,15 +49,14 @@
android:layout_marginRight="@dimen/dimen3"
android:paddingLeft="@dimen/margin12"
android:src="@drawable/ic_chevron_right_black_18dp" />

<View
android:id="@+id/line"
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_alignParentBottom="true"
android:background="@color/ios_toolbar_line" />
</RelativeLayout>

<View
android:id="@+id/line"
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_alignParentBottom="true"
android:layout_toRightOf="@+id/image_view"
android:background="@color/ios_toolbar_line" />


</LinearLayout>
4 changes: 3 additions & 1 deletion iosview/src/main/res/values/attrs.xml
Original file line number Diff line number Diff line change
@@ -41,7 +41,7 @@
</declare-styleable>
<declare-styleable name="ListItemView">
<attr name="liv_icon" format="reference" />
<attr name="liv_icon_padding" format="reference" />
<attr name="liv_icon_padding" format="dimension" />
<attr name="liv_text" format="string" />
<attr name="liv_arrow" format="reference" />
<attr name="liv_has_line" format="boolean" />
@@ -51,6 +51,7 @@
</declare-styleable>
<declare-styleable name="ListItemView2">
<attr name="liv2_icon" format="reference" />
<attr name="liv2_icon_padding" format="dimension" />
<attr name="liv2_head_text" format="string" />
<attr name="liv2_content_text" format="string" />
<attr name="liv2_has_line" format="boolean" />
@@ -65,6 +66,7 @@
<attr name="item_footer" format="string" />
<attr name="item_badge" format="string" />
<attr name="item_icon" format="reference" />
<attr name="item_icon_padding" format="dimension" />
<attr name="item_has_type" format="boolean" />
<attr name="item_circular_image" format="boolean" />
<attr name="item_heading_color" format="color" />