Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
d23759f1
Kaydet (Commit)
d23759f1
authored
Eyl 04, 2012
tarafından
Andrzej J.R. Hunt
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
More fragment lifecycle cleanup.
Change-Id: I93a19a080cc73bfa49b04f19b6e290ff9cd1b8bc
üst
c79b998a
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
49 additions
and
42 deletions
+49
-42
activity_presentation.xml
android/sdremote/res/layout/activity_presentation.xml
+10
-3
idlayout.xml
android/sdremote/res/layout/idlayout.xml
+0
-10
PresentationActivity.java
...c/org/libreoffice/impressremote/PresentationActivity.java
+33
-26
PresentationFragment.java
...c/org/libreoffice/impressremote/PresentationFragment.java
+4
-2
ThumbnailFragment.java
.../src/org/libreoffice/impressremote/ThumbnailFragment.java
+2
-1
No files found.
android/sdremote/res/layout/activity_presentation.xml
Dosyayı görüntüle @
d23759f1
<FrameLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:tools=
"http://schemas.android.com/tools"
android:id=
"@+id/framelayout"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:id=
"@+id/framelayout"
>
android:layout_height=
"match_parent"
>
</FrameLayout>
<view
android:id=
"@+id/presentation_interceptor"
android:layout_width=
"fill_parent"
android:layout_height=
"fill_parent"
class=
"org.libreoffice.impressremote.PresentationActivity$InterceptorLayout"
/>
</FrameLayout>
\ No newline at end of file
android/sdremote/res/layout/idlayout.xml
deleted
100644 → 0
Dosyayı görüntüle @
c79b998a
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:orientation=
"vertical"
android:id=
"@+id/presentation_innerFrame"
>
</LinearLayout>
\ No newline at end of file
android/sdremote/src/org/libreoffice/impressremote/PresentationActivity.java
Dosyayı görüntüle @
d23759f1
...
...
@@ -20,6 +20,7 @@ import android.preference.PreferenceManager;
import
android.support.v4.app.FragmentManager
;
import
android.support.v4.app.FragmentTransaction
;
import
android.text.format.DateFormat
;
import
android.util.AttributeSet
;
import
android.view.KeyEvent
;
import
android.view.LayoutInflater
;
import
android.view.MotionEvent
;
...
...
@@ -40,7 +41,7 @@ public class PresentationActivity extends SherlockFragmentActivity {
private
FrameLayout
mOuterLayout
;
private
ThumbnailFragment
mThumbnailFragment
;
private
PresentationFragment
mPresentationFragment
;
private
ActionBarManager
mActionBarManager
;
private
static
ActionBarManager
mActionBarManager
;
@Override
public
void
onCreate
(
Bundle
savedInstanceState
)
{
...
...
@@ -49,32 +50,22 @@ public class PresentationActivity extends SherlockFragmentActivity {
bindService
(
new
Intent
(
this
,
CommunicationService
.
class
),
mConnection
,
Context
.
BIND_IMPORTANT
);
setContentView
(
R
.
layout
.
activity_presentation
);
mOuterLayout
=
(
FrameLayout
)
findViewById
(
R
.
id
.
framelayout
);
mOuterLayout
.
removeAllViews
();
mLayout
=
new
InterceptorLayout
(
this
);
mOuterLayout
.
addView
(
mLayout
);
mLayout
.
setId
(
R
.
id
.
presentation_innerFrame
);
//((FrameLayout) findViewById(R.id.framelayout)).addView(mLayout);
setContentView
(
R
.
layout
.
activity_presentation
);
if
(
savedInstanceState
==
null
)
{
mThumbnailFragment
=
new
ThumbnailFragment
();
mPresentationFragment
=
new
PresentationFragment
();
FragmentManager
fragmentManager
=
getSupportFragmentManager
();
FragmentTransaction
fragmentTransaction
=
fragmentManager
.
beginTransaction
();
fragmentTransaction
.
add
(
R
.
id
.
presentation_in
nerFrame
,
fragmentTransaction
.
add
(
R
.
id
.
presentation_in
terceptor
,
mPresentationFragment
,
"fragment_presentation"
);
fragmentTransaction
.
commit
();
}
}
@Override
protected
void
onSaveInstanceState
(
Bundle
outState
)
{
super
.
onSaveInstanceState
(
outState
);
outState
.
putBoolean
(
"thumbnail_enabled"
,
mThumbnailFragment
.
isVisible
());
mOuterLayout
=
(
FrameLayout
)
findViewById
(
R
.
id
.
framelayout
);
mLayout
=
(
FrameLayout
)
findViewById
(
R
.
id
.
presentation_interceptor
);
}
@Override
...
...
@@ -90,8 +81,10 @@ public class PresentationActivity extends SherlockFragmentActivity {
.
getDefaultSharedPreferences
(
this
);
boolean
aVolumeSwitching
=
aPref
.
getBoolean
(
"option_volumeswitching"
,
false
);
boolean
aRelevantFragmentVisible
=
mPresentationFragment
.
isVisible
()
||
mThumbnailFragment
.
isVisible
();
boolean
aRelevantFragmentVisible
=
((
mPresentationFragment
!=
null
)
&&
mPresentationFragment
.
isVisible
())
||
((
mThumbnailFragment
!=
null
)
&&
mThumbnailFragment
.
isVisible
());
if
(
aVolumeSwitching
&&
aRelevantFragmentVisible
)
{
int
action
=
event
.
getAction
();
...
...
@@ -119,7 +112,9 @@ public class PresentationActivity extends SherlockFragmentActivity {
mCommunicationService
=
((
CommunicationService
.
CBinder
)
aService
)
.
getService
();
mThumbnailFragment
.
setCommunicationService
(
mCommunicationService
);
if
(
mThumbnailFragment
!=
null
)
mThumbnailFragment
.
setCommunicationService
(
mCommunicationService
);
}
...
...
@@ -149,8 +144,10 @@ public class PresentationActivity extends SherlockFragmentActivity {
startActivity
(
aIntent
);
return
true
;
case
R
.
id
.
actionbar_presentation_submenu_blank
:
boolean
aRelevantFragmentVisible
=
mPresentationFragment
.
isVisible
()
||
mThumbnailFragment
.
isVisible
();
boolean
aRelevantFragmentVisible
=
(
mPresentationFragment
!=
null
&&
mPresentationFragment
.
isVisible
())
||
(
mThumbnailFragment
!=
null
&&
mThumbnailFragment
.
isVisible
());
if
(
aRelevantFragmentVisible
)
{
BlankScreenFragment
aFragment
=
new
BlankScreenFragment
(
...
...
@@ -158,7 +155,7 @@ public class PresentationActivity extends SherlockFragmentActivity {
FragmentTransaction
ft
=
getSupportFragmentManager
()
.
beginTransaction
();
ft
.
replace
(
R
.
id
.
presentation_in
nerFrame
,
aFragment
);
ft
.
replace
(
R
.
id
.
presentation_in
terceptor
,
aFragment
);
ft
.
setTransition
(
FragmentTransaction
.
TRANSIT_FRAGMENT_OPEN
);
ft
.
addToBackStack
(
null
);
ft
.
commit
();
...
...
@@ -372,10 +369,20 @@ public class PresentationActivity extends SherlockFragmentActivity {
Timer
aTimer
=
mCommunicationService
.
getSlideShow
().
getTimer
();
// --------------------------------- ACTIONBAR BUTTONS -------------
if
(
aSource
==
mThumbnailButton
)
{
if
(
mThumbnailFragment
==
null
)
{
mThumbnailFragment
=
(
ThumbnailFragment
)
getSupportFragmentManager
()
.
findFragmentByTag
(
"ThumbnailFragment"
);
if
(
mThumbnailFragment
==
null
)
{
mThumbnailFragment
=
new
ThumbnailFragment
();
mThumbnailFragment
.
setCommunicationService
(
mCommunicationService
);
}
}
if
(!
mThumbnailFragment
.
isVisible
())
{
FragmentTransaction
ft
=
getSupportFragmentManager
()
.
beginTransaction
();
ft
.
replace
(
R
.
id
.
presentation_innerFrame
,
mThumbnailFragment
);
ft
.
replace
(
R
.
id
.
presentation_interceptor
,
mThumbnailFragment
,
"ThumbnailFragment"
);
ft
.
setTransition
(
FragmentTransaction
.
TRANSIT_FRAGMENT_OPEN
);
ft
.
addToBackStack
(
null
);
ft
.
commit
();
...
...
@@ -480,10 +487,10 @@ public class PresentationActivity extends SherlockFragmentActivity {
* @author andy
*
*/
p
rivate
class
InterceptorLayout
extends
FrameLayout
{
p
ublic
static
class
InterceptorLayout
extends
FrameLayout
{
public
InterceptorLayout
(
Context
context
)
{
super
(
context
);
public
InterceptorLayout
(
Context
context
,
AttributeSet
aAttrs
)
{
super
(
context
,
aAttrs
);
}
@Override
...
...
android/sdremote/src/org/libreoffice/impressremote/PresentationFragment.java
Dosyayı görüntüle @
d23759f1
...
...
@@ -59,7 +59,8 @@ public class PresentationFragment extends SherlockFragment {
if
(
mTopView
!=
null
)
{
mTopView
.
setAdapter
(
new
ThumbnailAdapter
(
mContext
,
mCommunicationService
.
getSlideShow
()));
mTopView
.
setSelection
(
mCommunicationService
.
getSlideShow
().
getCurrentSlide
(),
true
);
mTopView
.
setSelection
(
mCommunicationService
.
getSlideShow
()
.
getCurrentSlide
(),
true
);
mTopView
.
setOnItemSelectedListener
(
new
ClickListener
());
}
...
...
@@ -75,12 +76,13 @@ public class PresentationFragment extends SherlockFragment {
public
View
onCreateView
(
LayoutInflater
inflater
,
ViewGroup
container
,
Bundle
savedInstanceState
)
{
setRetainInstance
(
true
);
getActivity
().
bindService
(
new
Intent
(
getActivity
().
getApplicationContext
(),
CommunicationService
.
class
),
mConnection
,
Context
.
BIND_IMPORTANT
);
mContext
=
getActivity
().
getApplicationContext
();
container
.
removeAllViews
();
//
container.removeAllViews();
View
v
=
inflater
.
inflate
(
R
.
layout
.
fragment_presentation
,
container
,
false
);
...
...
android/sdremote/src/org/libreoffice/impressremote/ThumbnailFragment.java
Dosyayı görüntüle @
d23759f1
...
...
@@ -46,7 +46,8 @@ public class ThumbnailFragment extends SherlockFragment {
public
View
onCreateView
(
LayoutInflater
inflater
,
ViewGroup
container
,
Bundle
savedInstanceState
)
{
// Inflate the layout for this fragment
container
.
removeAllViews
();
// container.removeAllViews();
setRetainInstance
(
true
);
View
v
=
inflater
.
inflate
(
R
.
layout
.
fragment_thumbnail
,
container
,
false
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment