Commit 7b883f62 authored by Luboš Horáček's avatar Luboš Horáček

Zobrazování zoomovaných článků a jejich bublin v dialogu

parent dc570cbc
...@@ -21,13 +21,15 @@ ...@@ -21,13 +21,15 @@
android:id="@+id/frame_content" android:id="@+id/frame_content"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:clipChildren="false" > android:background="@color/light_tansparent"
android:gravity="center" >
<ImageView <ImageView
android:id="@+id/imageView_column" android:id="@+id/imageView_column"
android:layout_width="match_parent" android:layout_width="wrap_content"
android:layout_height="match_parent" android:layout_height="wrap_content"
android:scaleType="centerInside" android:layout_margin="10dp"
android:background="@drawable/newuser_dialog_background"
android:src="@color/transparent" /> android:src="@color/transparent" />
<cz.nic.tablexia.widget.RatioPositionTextView <cz.nic.tablexia.widget.RatioPositionTextView
...@@ -42,14 +44,14 @@ ...@@ -42,14 +44,14 @@
android:textSize="@dimen/newuseranim_newspaper_topic_fontsize" android:textSize="@dimen/newuseranim_newspaper_topic_fontsize"
android:visibility="gone" android:visibility="gone"
custom:displayRatioType="height" custom:displayRatioType="height"
custom:xPositionRatio="0.00" custom:xPositionRatio="0.2"
custom:yPositionRatio="0.1" /> custom:yPositionRatio="0.1" />
<cz.nic.tablexia.widget.RatioPositionTextView <cz.nic.tablexia.widget.RatioPositionTextView
android:id="@+id/newuseranim_bubble_balloon" android:id="@+id/newuseranim_bubble_balloon"
android:layout_width="@dimen/newuseranim_newspaper_topicbubble_width" android:layout_width="@dimen/newuseranim_newspaper_topicbubble_width"
android:layout_height="@dimen/newuseranim_newspaper_topicbubble_height" android:layout_height="@dimen/newuseranim_newspaper_topicbubble_height"
android:background="@drawable/newuser_helpbubble_straight" android:background="@drawable/newuser_helpbubble_left"
android:gravity="center" android:gravity="center"
android:minEms="2" android:minEms="2"
android:text="@string/newuseranim_topic_2" android:text="@string/newuseranim_topic_2"
...@@ -57,8 +59,8 @@ ...@@ -57,8 +59,8 @@
android:textSize="@dimen/newuseranim_newspaper_topic_fontsize" android:textSize="@dimen/newuseranim_newspaper_topic_fontsize"
android:visibility="gone" android:visibility="gone"
custom:displayRatioType="height" custom:displayRatioType="height"
custom:xPositionRatio="0.00" custom:xPositionRatio="0.2"
custom:yPositionRatio="0.1" /> custom:yPositionRatio="0.2" />
<cz.nic.tablexia.widget.RatioPositionTextView <cz.nic.tablexia.widget.RatioPositionTextView
android:id="@+id/newuseranim_bubble_motocycle" android:id="@+id/newuseranim_bubble_motocycle"
...@@ -72,14 +74,14 @@ ...@@ -72,14 +74,14 @@
android:textSize="@dimen/newuseranim_newspaper_topic_fontsize" android:textSize="@dimen/newuseranim_newspaper_topic_fontsize"
android:visibility="gone" android:visibility="gone"
custom:displayRatioType="height" custom:displayRatioType="height"
custom:xPositionRatio="0.00" custom:xPositionRatio="0.2"
custom:yPositionRatio="0.1" /> custom:yPositionRatio="0.1" />
<cz.nic.tablexia.widget.RatioPositionTextView <cz.nic.tablexia.widget.RatioPositionTextView
android:id="@+id/newuseranim_bubble_swimsuit" android:id="@+id/newuseranim_bubble_swimsuit"
android:layout_width="@dimen/newuseranim_newspaper_topicbubble_width" android:layout_width="@dimen/newuseranim_newspaper_topicbubble_width"
android:layout_height="@dimen/newuseranim_newspaper_topicbubble_height" android:layout_height="@dimen/newuseranim_newspaper_topicbubble_height"
android:background="@drawable/newuser_helpbubble_straight" android:background="@drawable/newuser_helpbubble_left"
android:gravity="center" android:gravity="center"
android:minEms="2" android:minEms="2"
android:text="@string/newuseranim_topic_4" android:text="@string/newuseranim_topic_4"
...@@ -87,7 +89,7 @@ ...@@ -87,7 +89,7 @@
android:textSize="@dimen/newuseranim_newspaper_topic_fontsize" android:textSize="@dimen/newuseranim_newspaper_topic_fontsize"
android:visibility="gone" android:visibility="gone"
custom:displayRatioType="height" custom:displayRatioType="height"
custom:xPositionRatio="0.00" custom:xPositionRatio="0.2"
custom:yPositionRatio="0.1" /> custom:yPositionRatio="0.1" />
<cz.nic.tablexia.widget.RatioPositionTextView <cz.nic.tablexia.widget.RatioPositionTextView
...@@ -102,7 +104,7 @@ ...@@ -102,7 +104,7 @@
android:textSize="@dimen/newuseranim_newspaper_topic_fontsize" android:textSize="@dimen/newuseranim_newspaper_topic_fontsize"
android:visibility="gone" android:visibility="gone"
custom:displayRatioType="height" custom:displayRatioType="height"
custom:xPositionRatio="0.00" custom:xPositionRatio="0.15"
custom:yPositionRatio="0.1" /> custom:yPositionRatio="0.1" />
</RelativeLayout> </RelativeLayout>
\ No newline at end of file
...@@ -45,6 +45,7 @@ ...@@ -45,6 +45,7 @@
<color name="main_menu_divider">#c7b299</color> <color name="main_menu_divider">#c7b299</color>
<color name="mainmenu_childimte_border">#cbb69c</color> <color name="mainmenu_childimte_border">#cbb69c</color>
<color name="dark_tansparent">#BB000000</color> <color name="dark_tansparent">#BB000000</color>
<color name="light_tansparent">#88000000</color>
<color name="screen_encyclopedia_background">#f8ecd4</color> <color name="screen_encyclopedia_background">#f8ecd4</color>
<color name="screen_loader_versionname">#536b73</color> <color name="screen_loader_versionname">#536b73</color>
......
...@@ -4,13 +4,15 @@ ...@@ -4,13 +4,15 @@
package cz.nic.tablexia.newusers.fragment; package cz.nic.tablexia.newusers.fragment;
import android.app.Dialog;
import android.content.Intent; import android.content.Intent;
import android.graphics.Rect;
import android.os.Bundle; import android.os.Bundle;
import android.support.v4.content.LocalBroadcastManager; import android.support.v4.content.LocalBroadcastManager;
import android.view.View; import android.view.View;
import android.view.View.OnClickListener; import android.view.View.OnClickListener;
import android.view.Window;
import android.widget.ImageView; import android.widget.ImageView;
import android.widget.ImageView.ScaleType;
import cz.nic.tablexia.R; import cz.nic.tablexia.R;
import cz.nic.tablexia.widget.TablexiaDialog; import cz.nic.tablexia.widget.TablexiaDialog;
...@@ -18,14 +20,14 @@ import cz.nic.tablexia.widget.TablexiaDialog; ...@@ -18,14 +20,14 @@ import cz.nic.tablexia.widget.TablexiaDialog;
* @author lhoracek * @author lhoracek
*/ */
public class NewspaperDialog extends TablexiaDialog { public class NewspaperDialog extends TablexiaDialog {
public static final String BUBBLE_KEY = "VIEW_TEXT_BUBBLE"; public static final String BUBBLE_KEY = "VIEW_TEXT_BUBBLE";
public static final String IMAGE_KEY = "IMAGE_CONTENT"; public static final String IMAGE_KEY = "IMAGE_CONTENT";
public static final String DETECTIVE_KEY = "DETECTIVE"; public static final String DETECTIVE_KEY = "DETECTIVE";
@Override @Override
public Dialog onCreateDialog(Bundle savedInstanceState) { public void onCreate(Bundle savedInstanceState) {
final Dialog dialog = super.onCreateDialog(savedInstanceState); super.onCreate(savedInstanceState);
return dialog; setStyle(STYLE_NO_FRAME, android.R.style.Theme_Holo_Light);
} }
@Override @Override
...@@ -36,12 +38,24 @@ public class NewspaperDialog extends TablexiaDialog { ...@@ -36,12 +38,24 @@ public class NewspaperDialog extends TablexiaDialog {
@Override @Override
public void onViewCreated(View view, Bundle savedInstanceState) { public void onViewCreated(View view, Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState); super.onViewCreated(view, savedInstanceState);
Rect displayRectangle = new Rect();
Window window = getActivity().getWindow();
window.getDecorView().getWindowVisibleDisplayFrame(displayRectangle);
// inflate and adjust layout
view.setMinimumWidth(displayRectangle.width());
view.setMinimumHeight(displayRectangle.height());
int idBubble = getArguments().getInt(BUBBLE_KEY); int idBubble = getArguments().getInt(BUBBLE_KEY);
int idImage = getArguments().getInt(IMAGE_KEY); int idImage = getArguments().getInt(IMAGE_KEY);
view.findViewById(idBubble).setVisibility(View.VISIBLE); view.findViewById(idBubble).setVisibility(View.VISIBLE);
ImageView iv = (ImageView) view.findViewById(R.id.imageView_column); ImageView iv = (ImageView) view.findViewById(R.id.imageView_column);
iv.setImageResource(idImage); iv.setImageResource(idImage);
iv.setScaleType(ScaleType.FIT_CENTER);
iv.setAdjustViewBounds(true);
view.setOnClickListener(new OnClickListener() { view.setOnClickListener(new OnClickListener() {
@Override @Override
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment