mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
Resaved JuceDemo Android project
This commit is contained in:
parent
e11e8563c8
commit
f07cf50a3e
1 changed files with 25 additions and 6 deletions
|
|
@ -66,6 +66,7 @@ public class JuceDemo extends Activity
|
|||
{
|
||||
super.onCreate (savedInstanceState);
|
||||
|
||||
isScreenSaverEnabled = true;
|
||||
viewHolder = new ViewHolder (this);
|
||||
setContentView (viewHolder);
|
||||
|
||||
|
|
@ -141,6 +142,7 @@ public class JuceDemo extends Activity
|
|||
|
||||
//==============================================================================
|
||||
private ViewHolder viewHolder;
|
||||
private boolean isScreenSaverEnabled;
|
||||
|
||||
public final ComponentPeerView createNewView (boolean opaque, long host)
|
||||
{
|
||||
|
|
@ -222,6 +224,24 @@ public class JuceDemo extends Activity
|
|||
canvas.clipRect (left, top, right, bottom, android.graphics.Region.Op.DIFFERENCE);
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
public final void setScreenSaver (boolean enabled)
|
||||
{
|
||||
if (isScreenSaverEnabled != enabled)
|
||||
{
|
||||
isScreenSaverEnabled = enabled;
|
||||
if (enabled)
|
||||
getWindow().clearFlags (WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
|
||||
else
|
||||
getWindow().addFlags (WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
|
||||
}
|
||||
}
|
||||
|
||||
public final boolean getScreenSaver ()
|
||||
{
|
||||
return isScreenSaverEnabled;
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
public final String getClipboardContent()
|
||||
{
|
||||
|
|
@ -699,11 +719,10 @@ public class JuceDemo extends Activity
|
|||
private long position;
|
||||
}
|
||||
|
||||
public static final HTTPStream createHTTPStream (String address,
|
||||
boolean isPost, byte[] postData, String headers,
|
||||
int timeOutMs, int[] statusCode,
|
||||
StringBuffer responseHeaders,
|
||||
int numRedirectsToFollow)
|
||||
public static final HTTPStream createHTTPStream (String address, boolean isPost, byte[] postData,
|
||||
String headers, int timeOutMs, int[] statusCode,
|
||||
StringBuffer responseHeaders, int numRedirectsToFollow,
|
||||
String httpRequestCmd)
|
||||
{
|
||||
// timeout parameter of zero for HttpUrlConnection is a blocking connect (negative value for juce::URL)
|
||||
if (timeOutMs < 0)
|
||||
|
|
@ -744,9 +763,9 @@ public class JuceDemo extends Activity
|
|||
}
|
||||
}
|
||||
|
||||
connection.setRequestMethod (httpRequestCmd);
|
||||
if (isPost)
|
||||
{
|
||||
connection.setRequestMethod ("POST");
|
||||
connection.setDoOutput (true);
|
||||
|
||||
if (postData != null)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue