Commit 01b964d7 authored by Luboš Horáček's avatar Luboš Horáček

Merge branch 'devel' of gitlab.labs.nic.cz:labs/tablexia into devel

parents 7b7bf476 a20c1d26
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:background="@color/white" >
<ImageView
android:id="@+id/newuser_mugshot_photo"
android:layout_width="@dimen/newuser_mugshot_picker_photo_width"
android:layout_height="match_parent"
android:src="@drawable/mugshot00"
android:adjustViewBounds="true"
android:scaleType="centerCrop"/>
<ImageView
android:id="@+id/newuser_mugshot_film"
android:layout_width="@dimen/newuser_mugshot_picker_photo_width"
android:layout_height="match_parent"
android:src="@drawable/newuser_film"
android:adjustViewBounds="true"
android:scaleType="fitXY"/>
</RelativeLayout>
......@@ -16,9 +16,9 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<WebView xmlns:android="http://schemas.android.com/apk/res/android"
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/webView_content"
android:id="@+id/webView_container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/white" />
......@@ -128,5 +128,6 @@
<dimen name="newuser_seekbar_framelayout_height">85dp</dimen>
<dimen name="newuser_seekbar_background_margin_top">22dp</dimen>
<dimen name="newuser_seekbar_thumb_offset">2dp</dimen>
<dimen name="newuser_mugshot_picker_photo_width">300dp</dimen>
</resources>
......@@ -73,10 +73,10 @@ public abstract class AbstractMenuFragment extends Fragment {
private class FragmentDataPreloader extends AsyncTask<Integer, Void, View> {
View layoutView = null;
@Override
protected View doInBackground(final Integer... params) {
View layoutView = null;
// INTRO SOUND
if (introSoundPath != null) {
......@@ -133,6 +133,7 @@ public abstract class AbstractMenuFragment extends Fragment {
});
onFragmentResume();
}
loaderTask = null;
}
protected void fragmentContentVisible() {
......
......@@ -19,6 +19,7 @@
package cz.nic.tablexia.menu.mainmenu.screen.encyclopedia;
import android.view.View;
import android.view.ViewGroup;
import android.webkit.WebView;
import cz.nic.tablexia.R;
import cz.nic.tablexia.menu.mainmenu.screen.AbstractMenuFragment;
......@@ -40,9 +41,11 @@ public abstract class WebViewFragment extends AbstractMenuFragment {
@Override
protected void syncFragmentDataLoad(View layoutView) {
View webView = layoutView.findViewById(R.id.webView_content);
if (webView != null) {
mWebView = (WebView) webView;
View containerView = layoutView.findViewById(R.id.webView_container);
if (containerView != null) {
ViewGroup container = (ViewGroup) containerView;
mWebView = new WebView(getTablexiaContext());
container.addView(mWebView);
mWebView.loadUrl(getUrl());
mWebView.getSettings().setJavaScriptEnabled(true);
mWebView.getSettings().setSaveFormData(true);
......@@ -50,6 +53,12 @@ public abstract class WebViewFragment extends AbstractMenuFragment {
mWebView.setWebViewClient(new OpenBrowserWebViewClient(getActivity()));
}
}
@Override
public void onDestroyView() {
super.onDestroyView();
mWebView = null;
}
@Override
public void onFragmentResume() {
......
......@@ -93,7 +93,10 @@ import cz.nic.tablexia.widget.TablexiaButtonViewDialog;
public class NewUserFormFragment extends RoboFragment implements OnClickListener, OnDropListener {
private static final String TAG = NewUserFormFragment.class.getSimpleName();
private static final int NUMBER_OF_PHOTOS = 9;
private static final String MUGSHOT_FILE_NAME = "mugshot";
private static final String MUGSHOT_FILE_EXTENSION = ".png";
private static final int FIRST_AVAILABLE_PHOTO_INDEX = 10;
private static final int NUMBER_OF_PHOTOS = 6;
@InjectView(R.id.newuser_mugshot_image) ImageView imageViewMugshot;
@InjectView(R.id.newuser_stamper_image) @Nullable ImageView imageViewStamper;
......@@ -235,13 +238,20 @@ public class NewUserFormFragment extends RoboFragment implements OnClickListener
LinearLayout ll = (LinearLayout) mugshotPicker.findViewById(R.id.newuser_avatars);
for (int i = 0; i < NUMBER_OF_PHOTOS; i++) {
ImageView iv = new ImageView(getActivity());
String avatarPictureName = "mugshot0" + (i + 1);
iv.setImageDrawable(getResources().getDrawable(R.drawable.newuser_film));
iv.setBackgroundResource((getResources().getIdentifier(avatarPictureName, "drawable", getActivity().getPackageName())));
iv.setTag(avatarPictureName);
iv.setOnClickListener(new OnClickListener() {
for (int i = FIRST_AVAILABLE_PHOTO_INDEX; i < (FIRST_AVAILABLE_PHOTO_INDEX + NUMBER_OF_PHOTOS); i++) {
View mugshotView = inflater.inflate(R.layout.newuser_mugshot_rectangle, null);
ImageView photo = (ImageView) mugshotView.findViewById(R.id.newuser_mugshot_photo);
ImageView film = (ImageView) mugshotView.findViewById(R.id.newuser_mugshot_film);
String photoNumber;
if (i < 10) {
photoNumber = "0" + i;
} else {
photoNumber = Integer.toString(i);
}
String avatarPictureName = MUGSHOT_FILE_NAME + photoNumber;
photo.setImageResource((getResources().getIdentifier(avatarPictureName, "drawable", getActivity().getPackageName())));
photo.setTag(avatarPictureName);
photo.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
......@@ -258,9 +268,9 @@ public class NewUserFormFragment extends RoboFragment implements OnClickListener
}
});
ViewGroup.LayoutParams lp = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.MATCH_PARENT);
iv.setAdjustViewBounds(true);
ll.addView(iv, lp);
film.setMinimumWidth(photo.getMeasuredWidth());
ll.addView(mugshotView);
}
view.addOnLayoutChangeListener(new OnLayoutChangeListener() {
......@@ -679,7 +689,7 @@ public class NewUserFormFragment extends RoboFragment implements OnClickListener
if (btnSubscribe != null) {
boolean isMale = sex == Sex.MALE;
coverName = coverNameET.getText().toString();
User newUser = new User(coverName, age, isMale, avatarName, true, false, subscriptionFileName);
User newUser = new User(coverName, age, isMale, avatarName, true, false, subscriptionFileName);
newUser.save();
Intent data = new Intent();
......
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