0

i've developed an App that shows a ShinobiCharts DonutChart. Inside the donut i attached a view that shows correctly in a Galaxy Tab A and a Nexus 9 but shows too tiny on a nexus 7. The problem is the background image of this view (i attached an image to show the problem)... so i tried to change the image background size but it doesn't lead to how the image shows... someone can tell me why?

Here the layout of view:

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/RelativeLayout1"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:background="@android:color/transparent"
    android:orientation="vertical" >

    <ImageView
        android:id="@+id/imageView1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentTop="true"
        android:layout_centerHorizontal="true"
        android:layout_gravity="center|center_vertical|center_horizontal"
        android:src="@drawable/cerchio_centro_chartpie" />

    <TextView
        android:id="@+id/centro_line1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentTop="true"
        android:layout_centerHorizontal="true"
        android:layout_marginTop="33dp"
        android:text="TOTALE"
        android:textColor="@color/title_gray"
        android:textSize="18sp"
        android:textStyle="bold" />

    <TextView
        android:id="@+id/centro_line2"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignStart="@+id/centro_line1"
        android:layout_centerHorizontal="true"
        android:layout_below="@+id/centro_line1"
        android:layout_marginTop="5dp"
        android:text="TextView"
        android:textSize="16sp"
        android:textStyle="bold" />

</RelativeLayout>

and here the result:

Donut failed

Donut failed 2, added border to containing view

tassadar
  • 55
  • 1
  • 10

1 Answers1

0

The top level objects within the shinobicharts Android library essentially extend the View or Fragment class. As such, they should not affect the way an image which they are laid upon is scaled.

From your images I assume that you have used a transparent background on your chart, and laid the chart over the top of your layout containing your image. I notice that the Nexus 7 has a hdpi density whereas the tab a has a mdpi density. As such it is important to have your desired image, duplicated and scaled correctly in the appropriate drawable folder. I would recommend you confirm that you are scaling your images correctly - a good place for guidance is here:

http://developer.android.com/guide/practices/screens_support.html

Specifically consult the section entitled ‘Alternative drawables’.

A good tip to get an understanding of which image android chooses for which device is to initially use different (but scaled correctly and located in the appropriate drawable folder) images for each density.

Once again, I do not believe this is an issue caused by the shinobicharts library.

Disclaimer: I work for shinobicontrols.

Kai
  • 186
  • 2
  • 10