Defend
8 years ago
16 changed files with 334 additions and 264 deletions
@ -1,12 +0,0 @@ |
|||||
<component name="libraryTable"> |
|
||||
<library name="animated-vector-drawable-23.4.0"> |
|
||||
<CLASSES> |
|
||||
<root url="file://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.android.support/animated-vector-drawable/23.4.0/res" /> |
|
||||
<root url="jar://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.android.support/animated-vector-drawable/23.4.0/jars/classes.jar!/" /> |
|
||||
</CLASSES> |
|
||||
<JAVADOC /> |
|
||||
<SOURCES> |
|
||||
<root url="jar://$USER_HOME$/AppData/Local/Android/sdk/extras/android/m2repository/com/android/support/animated-vector-drawable/23.4.0/animated-vector-drawable-23.4.0-sources.jar!/" /> |
|
||||
</SOURCES> |
|
||||
</library> |
|
||||
</component> |
|
@ -1,15 +0,0 @@ |
|||||
<component name="libraryTable"> |
|
||||
<library name="appcompat-v7-23.4.0"> |
|
||||
<ANNOTATIONS> |
|
||||
<root url="jar://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.android.support/appcompat-v7/23.4.0/annotations.zip!/" /> |
|
||||
</ANNOTATIONS> |
|
||||
<CLASSES> |
|
||||
<root url="jar://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.android.support/appcompat-v7/23.4.0/jars/classes.jar!/" /> |
|
||||
<root url="file://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.android.support/appcompat-v7/23.4.0/res" /> |
|
||||
</CLASSES> |
|
||||
<JAVADOC /> |
|
||||
<SOURCES> |
|
||||
<root url="jar://$USER_HOME$/AppData/Local/Android/sdk/extras/android/m2repository/com/android/support/appcompat-v7/23.4.0/appcompat-v7-23.4.0-sources.jar!/" /> |
|
||||
</SOURCES> |
|
||||
</library> |
|
||||
</component> |
|
@ -1,15 +0,0 @@ |
|||||
<component name="libraryTable"> |
|
||||
<library name="design-23.4.0"> |
|
||||
<ANNOTATIONS> |
|
||||
<root url="jar://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.android.support/design/23.4.0/annotations.zip!/" /> |
|
||||
</ANNOTATIONS> |
|
||||
<CLASSES> |
|
||||
<root url="jar://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.android.support/design/23.4.0/jars/classes.jar!/" /> |
|
||||
<root url="file://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.android.support/design/23.4.0/res" /> |
|
||||
</CLASSES> |
|
||||
<JAVADOC /> |
|
||||
<SOURCES> |
|
||||
<root url="jar://$USER_HOME$/AppData/Local/Android/sdk/extras/android/m2repository/com/android/support/design/23.4.0/design-23.4.0-sources.jar!/" /> |
|
||||
</SOURCES> |
|
||||
</library> |
|
||||
</component> |
|
@ -1,15 +0,0 @@ |
|||||
<component name="libraryTable"> |
|
||||
<library name="recyclerview-v7-23.4.0"> |
|
||||
<ANNOTATIONS> |
|
||||
<root url="jar://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.android.support/recyclerview-v7/23.4.0/annotations.zip!/" /> |
|
||||
</ANNOTATIONS> |
|
||||
<CLASSES> |
|
||||
<root url="file://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.android.support/recyclerview-v7/23.4.0/res" /> |
|
||||
<root url="jar://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.android.support/recyclerview-v7/23.4.0/jars/classes.jar!/" /> |
|
||||
</CLASSES> |
|
||||
<JAVADOC /> |
|
||||
<SOURCES> |
|
||||
<root url="jar://$USER_HOME$/AppData/Local/Android/sdk/extras/android/m2repository/com/android/support/recyclerview-v7/23.4.0/recyclerview-v7-23.4.0-sources.jar!/" /> |
|
||||
</SOURCES> |
|
||||
</library> |
|
||||
</component> |
|
@ -1,11 +0,0 @@ |
|||||
<component name="libraryTable"> |
|
||||
<library name="support-annotations-23.4.0"> |
|
||||
<CLASSES> |
|
||||
<root url="jar://$USER_HOME$/AppData/Local/Android/sdk/extras/android/m2repository/com/android/support/support-annotations/23.4.0/support-annotations-23.4.0.jar!/" /> |
|
||||
</CLASSES> |
|
||||
<JAVADOC /> |
|
||||
<SOURCES> |
|
||||
<root url="jar://$USER_HOME$/AppData/Local/Android/sdk/extras/android/m2repository/com/android/support/support-annotations/23.4.0/support-annotations-23.4.0-sources.jar!/" /> |
|
||||
</SOURCES> |
|
||||
</library> |
|
||||
</component> |
|
@ -1,16 +0,0 @@ |
|||||
<component name="libraryTable"> |
|
||||
<library name="support-v4-23.4.0"> |
|
||||
<ANNOTATIONS> |
|
||||
<root url="jar://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.android.support/support-v4/23.4.0/annotations.zip!/" /> |
|
||||
</ANNOTATIONS> |
|
||||
<CLASSES> |
|
||||
<root url="file://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.android.support/support-v4/23.4.0/res" /> |
|
||||
<root url="jar://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.android.support/support-v4/23.4.0/jars/classes.jar!/" /> |
|
||||
<root url="jar://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.android.support/support-v4/23.4.0/jars/libs/internal_impl-23.4.0.jar!/" /> |
|
||||
</CLASSES> |
|
||||
<JAVADOC /> |
|
||||
<SOURCES> |
|
||||
<root url="jar://$USER_HOME$/AppData/Local/Android/sdk/extras/android/m2repository/com/android/support/support-v4/23.4.0/support-v4-23.4.0-sources.jar!/" /> |
|
||||
</SOURCES> |
|
||||
</library> |
|
||||
</component> |
|
@ -1,12 +0,0 @@ |
|||||
<component name="libraryTable"> |
|
||||
<library name="support-vector-drawable-23.4.0"> |
|
||||
<CLASSES> |
|
||||
<root url="jar://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.android.support/support-vector-drawable/23.4.0/jars/classes.jar!/" /> |
|
||||
<root url="file://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.android.support/support-vector-drawable/23.4.0/res" /> |
|
||||
</CLASSES> |
|
||||
<JAVADOC /> |
|
||||
<SOURCES> |
|
||||
<root url="jar://$USER_HOME$/AppData/Local/Android/sdk/extras/android/m2repository/com/android/support/support-vector-drawable/23.4.0/support-vector-drawable-23.4.0-sources.jar!/" /> |
|
||||
</SOURCES> |
|
||||
</library> |
|
||||
</component> |
|
@ -0,0 +1,94 @@ |
|||||
|
package ru.defend.defdevteam.tstu; |
||||
|
|
||||
|
import android.content.Context; |
||||
|
import android.net.Uri; |
||||
|
import android.os.Bundle; |
||||
|
import android.support.v4.app.Fragment; |
||||
|
import android.view.LayoutInflater; |
||||
|
import android.view.View; |
||||
|
import android.view.ViewGroup; |
||||
|
import android.widget.TextView; |
||||
|
|
||||
|
import org.w3c.dom.Text; |
||||
|
|
||||
|
public class NewsFragment extends Fragment { |
||||
|
private static final String ARG_PARAM1 = "title"; |
||||
|
private static final String ARG_PARAM2 = "text"; |
||||
|
private static final String ARG_PARAM3 = "link"; |
||||
|
private String mTitle; |
||||
|
private String mImgLink; |
||||
|
private String mText; |
||||
|
|
||||
|
|
||||
|
|
||||
|
private OnFragmentInteractionListener mListener; |
||||
|
|
||||
|
public NewsFragment() { |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public void onResume() { |
||||
|
super.onResume(); |
||||
|
if (getArguments() != null) { |
||||
|
mTitle = getArguments().getString(ARG_PARAM1); |
||||
|
mText = getArguments().getString(ARG_PARAM2); |
||||
|
mImgLink = getArguments().getString(ARG_PARAM3); |
||||
|
updateNewsFragment(); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
public static NewsFragment newInstance(NewsItemGroup group) { |
||||
|
NewsFragment newsFragment = new NewsFragment(); |
||||
|
Bundle arg = new Bundle(); |
||||
|
arg.putString(ARG_PARAM1, group.getTitle()); |
||||
|
arg.putString(ARG_PARAM2, group.getText()); |
||||
|
arg.putString(ARG_PARAM3, group.getLink()); |
||||
|
newsFragment.setArguments(arg); |
||||
|
return newsFragment; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public void onCreate(Bundle savedInstanceState) { |
||||
|
super.onCreate(savedInstanceState); |
||||
|
} |
||||
|
|
||||
|
public void updateNewsFragment() { |
||||
|
TextView titleTextView = (TextView) getActivity().findViewById(R.id.floatingnews_title); |
||||
|
TextView textView = (TextView) getActivity().findViewById(R.id.floatingnews_content); |
||||
|
titleTextView.setText(mTitle); |
||||
|
textView.setText(mText); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public View onCreateView(LayoutInflater inflater, ViewGroup container, |
||||
|
Bundle savedInstanceState) { |
||||
|
return inflater.inflate(R.layout.fragment_news, container, false); |
||||
|
} |
||||
|
|
||||
|
public void onButtonPressed(Uri uri) { |
||||
|
if (mListener != null) { |
||||
|
mListener.onFragmentInteraction(uri); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public void onAttach(Context context) { |
||||
|
super.onAttach(context); |
||||
|
if (context instanceof OnFragmentInteractionListener) { |
||||
|
mListener = (OnFragmentInteractionListener) context; |
||||
|
} else { |
||||
|
throw new RuntimeException(context.toString() |
||||
|
+ " must implement OnFragmentInteractionListener"); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public void onDetach() { |
||||
|
super.onDetach(); |
||||
|
mListener = null; |
||||
|
} |
||||
|
|
||||
|
public interface OnFragmentInteractionListener { |
||||
|
void onFragmentInteraction(Uri uri); |
||||
|
} |
||||
|
} |
@ -0,0 +1,48 @@ |
|||||
|
package ru.defend.defdevteam.tstu; |
||||
|
|
||||
|
/** |
||||
|
* Created by itsmy on 19.02.2017. |
||||
|
*/ |
||||
|
public class NewsItemGroup { |
||||
|
protected String title; |
||||
|
protected String text; |
||||
|
protected String link; |
||||
|
protected String fullText; |
||||
|
protected int viewID; |
||||
|
|
||||
|
public NewsItemGroup(String title, String text, String link) { |
||||
|
this.fullText = ""; |
||||
|
this.text = text; |
||||
|
this.title = title; |
||||
|
this.link = link; |
||||
|
this.viewID = -1; |
||||
|
} |
||||
|
|
||||
|
public String getTitle() { |
||||
|
return this.title; |
||||
|
} |
||||
|
|
||||
|
public String getText() { |
||||
|
return this.text; |
||||
|
} |
||||
|
|
||||
|
public String getLink() { |
||||
|
return this.link; |
||||
|
} |
||||
|
|
||||
|
public void setFullText(String fullText) { |
||||
|
this.fullText = fullText; |
||||
|
} |
||||
|
|
||||
|
public String getFullText() { |
||||
|
return this.fullText; |
||||
|
} |
||||
|
|
||||
|
public int getViewID() { |
||||
|
return viewID; |
||||
|
} |
||||
|
|
||||
|
public void setViewID(int viewID) { |
||||
|
this.viewID = viewID; |
||||
|
} |
||||
|
} |
@ -1,37 +1,26 @@ |
|||||
<?xml version="1.0" encoding="utf-8"?> |
<?xml version="1.0" encoding="utf-8"?> |
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" |
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" |
||||
xmlns:tools="http://schemas.android.com/tools" |
|
||||
android:orientation="vertical" |
|
||||
android:layout_width="match_parent" |
android:layout_width="match_parent" |
||||
android:layout_height="match_parent"> |
android:layout_height="match_parent" |
||||
|
android:id="@+id/floatingitem_instance" |
||||
|
android:clickable="true"> |
||||
|
|
||||
|
|
||||
<FrameLayout |
<FrameLayout |
||||
android:layout_width="match_parent" |
android:layout_width="match_parent" |
||||
android:layout_height="match_parent" |
android:layout_height="match_parent"> |
||||
android:alpha="0.4" |
|
||||
android:background="@android:color/darker_gray"> |
|
||||
|
|
||||
<RelativeLayout |
<FrameLayout |
||||
android:layout_width="match_parent" |
android:layout_width="match_parent" |
||||
android:layout_height="match_parent" |
android:layout_height="match_parent" |
||||
android:background="@android:color/background_light" |
android:alpha="0.6" |
||||
android:layout_margin="25dp" |
android:background="@android:color/darker_gray" |
||||
android:alpha="1"> |
android:id="@+id/floatingitem_first"> |
||||
|
|
||||
<TextView |
</FrameLayout> |
||||
android:text="TextView" |
|
||||
android:layout_width="match_parent" |
|
||||
android:layout_height="wrap_content" |
|
||||
android:layout_alignParentTop="true" |
|
||||
android:layout_alignParentLeft="true" |
|
||||
android:layout_alignParentStart="true" |
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Headline" |
|
||||
android:paddingBottom="10dp" |
|
||||
android:paddingTop="10dp" |
|
||||
android:gravity="center_horizontal" |
|
||||
android:alpha="1" |
|
||||
android:background="@android:color/background_light" /> |
|
||||
</RelativeLayout> |
|
||||
</FrameLayout> |
</FrameLayout> |
||||
|
|
||||
</LinearLayout> |
</LinearLayout> |
@ -0,0 +1,61 @@ |
|||||
|
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" |
||||
|
xmlns:tools="http://schemas.android.com/tools" |
||||
|
android:layout_width="match_parent" |
||||
|
android:layout_height="match_parent" |
||||
|
tools:context="ru.defend.defdevteam.tstu.NewsFragment" |
||||
|
android:id="@+id/fragment_news"> |
||||
|
|
||||
|
<ScrollView |
||||
|
android:layout_width="match_parent" |
||||
|
android:layout_height="match_parent"> |
||||
|
|
||||
|
<FrameLayout |
||||
|
android:layout_width="match_parent" |
||||
|
android:layout_height="match_parent"> |
||||
|
|
||||
|
<FrameLayout |
||||
|
android:layout_width="match_parent" |
||||
|
android:layout_height="match_parent" |
||||
|
android:alpha="0.6" |
||||
|
android:background="@android:color/darker_gray"> |
||||
|
|
||||
|
</FrameLayout> |
||||
|
|
||||
|
<LinearLayout |
||||
|
android:layout_width="match_parent" |
||||
|
android:orientation="vertical" |
||||
|
android:layout_height="wrap_content" |
||||
|
android:alpha="1" |
||||
|
android:layout_margin="25dp" |
||||
|
android:background="@android:color/background_light" |
||||
|
android:id="@+id/floatingitem_second"> |
||||
|
|
||||
|
<TextView |
||||
|
android:text="TextView" |
||||
|
android:layout_width="match_parent" |
||||
|
android:layout_height="wrap_content" |
||||
|
android:layout_alignParentTop="true" |
||||
|
android:layout_alignParentLeft="true" |
||||
|
android:layout_alignParentStart="true" |
||||
|
android:textAppearance="@style/TextAppearance.AppCompat.Headline" |
||||
|
android:paddingBottom="10dp" |
||||
|
android:paddingTop="10dp" |
||||
|
android:gravity="center_horizontal" |
||||
|
android:alpha="1" |
||||
|
android:background="@android:color/background_light" |
||||
|
android:id="@+id/floatingnews_title"/> |
||||
|
|
||||
|
<TextView |
||||
|
android:text="TextView" |
||||
|
android:layout_width="match_parent" |
||||
|
android:layout_height="wrap_content" |
||||
|
android:textAppearance="@style/TextAppearance.AppCompat" |
||||
|
android:id="@+id/floatingnews_content"/> |
||||
|
|
||||
|
</LinearLayout> |
||||
|
|
||||
|
</FrameLayout> |
||||
|
|
||||
|
</ScrollView> |
||||
|
|
||||
|
</FrameLayout> |
Loading…
Reference in new issue